This is the mail archive of the
mailing list for the GCC project.
Re: GCC stack backtraces
On 08/29/2012 08:40 PM, Toon Moene wrote:
On 08/29/2012 06:21 PM, Ian Lance Taylor wrote:
The DWARF reader calls malloc and is therefore not async-signal safe.
It also is a problem if the crash in the program is due to overwriting
the malloc heap administration (which easily occurs in Fortran if you
overwrite bounds of allocatable arrays that can't be caught by
bounds-check due to the wrong bounds being used inside a subroutine).
I have had Fortran program tracebacks (as described by Janne) hanging
due to this, which is hard to work around (euphemism).
I've seen hanging processes because a custom SIGSEGV crash handler
called malloc (indirectly from <stdio.h> functions). If we could
provide a more robust crash handler, I'm sure that would improve matters
in the long term.
The default std::unexpected handler for C++ could use this functionality
as well, and so could Ada (but I'm not sure if you can get a callback
when an unhandled exception is raised *before* the stack is unwound).
Florian Weimer / Red Hat Product Security Team