]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libfortran/68744 (FAIL: gfortran.dg/backtrace_1.f90 -O0 execution test)
authorJohn David Anglin <danglin@gcc.gnu.org>
Sat, 23 Jan 2016 23:32:13 +0000 (23:32 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sat, 23 Jan 2016 23:32:13 +0000 (23:32 +0000)
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.

From-SVN: r232770

libgfortran/ChangeLog
libgfortran/runtime/backtrace.c

index c993191f37195d0d58dcd77570983b1908c1ddaa..4c7befa2128c99cea165b5cdabda7cbb470dcb59 100644 (file)
@@ -1,3 +1,10 @@
+2016-01-23  John David Anglin  <danglin@gcc.gnu.org>
+
+       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.
+
 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
 
        * intrinsics/execute_command_line.c (set_cmdstat): Use "%s", msg
index a61363af2a6cdadede282d2dd1696e1e6fa0a232..5b8735d53f43554beda91ca0531ba7fa7314000f 100644 (file)
@@ -24,6 +24,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "libgfortran.h"
 
+#include <gthr.h>
+
 #include <string.h>
 #include <stdlib.h>
 #include <errno.h>
@@ -137,7 +139,11 @@ show_backtrace (bool in_signal_handler)
   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))
     {