Can I turn off the "backtracing" that appears after some gcc errors?
Printable View
Can I turn off the "backtracing" that appears after some gcc errors?
Continuation of this: http://cboard.cprogramming.com/showthread.php?t=106786
You could compile with a custom-built version of glibc, I guess. Other than that, see my other suggestion.
[edit] Why do you want to? Was my guess correct, more or less? [/edit]
What is the advantage of doing this, MK27--if that is your real name... which I am betting it is.
What is the advantage of doing this, MK27--if that is your real name... which I am betting it is.
Because the output doesn't tell me much other than that I should learn to use GDB or something. However, if I'm hack debugging by moving a "puts" statement around (which eventually solved my last fiasco), all that scrolling is a drag. That it can't be turned off is UNBELIEVABLE.
regarding my real name -- now that's a secret -- but you're right. Don't tell anyone, I hear they come in multiples!
and thanks dwk for your other suggestion about 2&>/dev/null (I think that's how it's done)
This thread is a few days old, I know...
The only way I can immediately imagine that a backtrace could be printed during a program crash is if the crash signal was trapped by the C library. This would imply that you could prevent the backtrace dump by overriding the crash signal handler. There are several ways a program could crash, the most likely being SIGSEGV, SIGBUS, SIGFPE, or SIGILL. Try resetting these handlers back to their defaults and see if the dumps go away.
Code:#include <signal.h>
signal(SIGSEGV, SIG_DFL);
signal(SIGBUS, SIG_DFL);
signal(SIGFPE, SIG_DFL);
signal(SIGILL, SIG_DFL);
thanks brewbuck, i will remember this the next time it bugs me.
I'm a little surprised you have to "imagine" a backtrace occuring, tho, as if it were a strange event? A "double free" will do it with my out-of-the-fedora-7 box gcc 4.12...