]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Don't call vg_assert inside sync_signalhandler_from_kernel
authorMark Wielaard <mark@klomp.org>
Fri, 5 Apr 2024 13:23:32 +0000 (15:23 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 5 Apr 2024 13:23:36 +0000 (15:23 +0200)
Calling vg_assert inside a core signal handler will mess up the core
backtrace. Making it even harder to find bugs in the core.

coregrind/m_signals.c

index 5977e38579fcd68f7c8e19586869f7b9deb7f618..cd3128d2b4bb9e0ac39ab64404ee520828c482b8 100644 (file)
@@ -2922,9 +2922,11 @@ void sync_signalhandler_from_kernel ( ThreadId tid,
       if (0)
          VG_(kill_self)(sigNo);  /* generate a core dump */
 
-      //if (tid == 0)            /* could happen after everyone has exited */
-      //  tid = VG_(master_tid);
-      vg_assert(tid != 0);
+      /* tid == 0 could happen after everyone has exited, which indicates
+         a bug in the core (cleanup) code.  Don't assert tid must be valid,
+         that will mess up the valgrind core backtrace if it fails, coming
+         from the signal handler. */
+      // vg_assert(tid != 0);
 
       UnwindStartRegs startRegs;
       VG_(memset)(&startRegs, 0, sizeof(startRegs));