2015-12-28 John David Anglin PR libfortran/68744 * runtime/backtrace.c: Include gthr.h. (show_backtrace): Use __gthread_active_p() to determine whether threads are active. Return if lbstate is NULL. Index: runtime/backtrace.c =================================================================== --- runtime/backtrace.c (revision 231814) +++ runtime/backtrace.c (working copy) @@ -24,6 +24,8 @@ #include "libgfortran.h" +#include + #include #include #include @@ -137,8 +139,12 @@ struct backtrace_state *lbstate; struct mystate state = { 0, false, in_signal_handler }; - lbstate = backtrace_create_state (NULL, 1, error_callback, NULL); + lbstate = backtrace_create_state (NULL, __gthread_active_p (), + error_callback, NULL); + if (lbstate == NULL) + return; + if (!BACKTRACE_SUPPORTED || (in_signal_handler && BACKTRACE_USES_MALLOC)) { /* If symbolic backtrace is not supported on this target, or would