When -fbacktrace is enabled, gfortran enables a signal handler for the common failure signals, and tries to print a backtrace in the handler. On Linux platforms this is accomplished with the glibc backtrace() and backtrace_symbols() functions. However, backtrace_symbols() uses malloc() to allocate memory and is hence not safe to use within a signal handler. It might be possible to instead use backtrace_symbols_fd() and output either directly to STDERR_FILENO, or to a pipe.
Assigning to myself.
Patch: http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01058.html
Author: jb Date: Sun May 22 16:38:05 2011 New Revision: 174030 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174030 Log: PR 48931 Make backtrace async-signal-safe, reformat output Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/config.h.in trunk/libgfortran/configure trunk/libgfortran/configure.ac trunk/libgfortran/runtime/backtrace.c trunk/libgfortran/runtime/main.c
Fixed, closing.
Author: jb Date: Sun May 29 20:13:52 2011 New Revision: 174415 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174415 Log: PR 48931 Use async-signal-safe execve instead of execvp Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/libgfortran.h trunk/libgfortran/runtime/backtrace.c trunk/libgfortran/runtime/compile_options.c trunk/libgfortran/runtime/main.c