]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Get more useful stack traces for internal errors/panics which happen
authorNicholas Nethercote <njn@valgrind.org>
Sun, 13 Mar 2005 04:39:28 +0000 (04:39 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 13 Mar 2005 04:39:28 +0000 (04:39 +0000)
during the exit cleanup.  Also, don't report stack growth failures if
the fault is actually way above the stack.

MERGED FROM CVS HEAD

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3322

coregrind/vg_signals.c

index 6ad4585acf5109cb2d3cbbaf29a51d06ee267ecb..dfa2c8c512ee01534b3f9105ce4b11f777ed3a4f 100644 (file)
@@ -1828,7 +1828,8 @@ void vg_sync_signalhandler ( Int sigNo, vki_siginfo_t *info, struct vki_ucontext
                         VG_(shadow_base), VG_(shadow_end));
       }
       if (info->si_code == 1 /* SEGV_MAPERR */
-         && fault >= (esp - ARCH_STACK_REDZONE_SIZE)) {
+         && fault >= (esp - ARCH_STACK_REDZONE_SIZE)
+          && fault < VG_(client_end)) {
         /* If the fault address is above esp but below the current known
            stack segment base, and it was a fault because there was
            nothing mapped there (as opposed to a permissions fault),
@@ -1925,7 +1926,9 @@ void vg_sync_signalhandler ( Int sigNo, vki_siginfo_t *info, struct vki_ucontext
       if (0)
         VG_(kill_self)(sigNo);         /* generate a core dump */
 
-      tst = VG_(get_ThreadState)(VG_(get_lwp_tid)(VG_(gettid)()));
+      if (tid == 0)            /* could happen after everyone has exited */
+        tid = VG_(master_tid);
+      tst = VG_(get_ThreadState)(tid);
       VG_(core_panic_at)("Killed by fatal signal",
                          VG_(get_ExeContext2)(UCONTEXT_INSTR_PTR(uc),
                                               UCONTEXT_FRAME_PTR(uc),