From: Mark Wielaard Date: Fri, 5 Apr 2024 13:23:32 +0000 (+0200) Subject: Don't call vg_assert inside sync_signalhandler_from_kernel X-Git-Tag: VALGRIND_3_23_0~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ff8c992aba475f4c4d93b9d022e878e388b6a96;p=thirdparty%2Fvalgrind.git Don't call vg_assert inside sync_signalhandler_from_kernel Calling vg_assert inside a core signal handler will mess up the core backtrace. Making it even harder to find bugs in the core. --- diff --git a/coregrind/m_signals.c b/coregrind/m_signals.c index 5977e3857..cd3128d2b 100644 --- a/coregrind/m_signals.c +++ b/coregrind/m_signals.c @@ -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));