[Bug libfortran/48931] New: Backtrace functionality not async-signal-safe

jb at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun May 8 19:27:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48931

           Summary: Backtrace functionality not async-signal-safe
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jb@gcc.gnu.org


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.



More information about the Gcc-bugs mailing list