From: Paul Floyd Date: Tue, 9 Nov 2021 22:11:15 +0000 (+0100) Subject: Bug 445032 valgrind/memcheck crash with SIGSEGV when SIGVTALRM timer used and libthr... X-Git-Tag: VALGRIND_3_19_0~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b8eddfde14291e288a7017edce5c7225e1533d6;p=thirdparty%2Fvalgrind.git Bug 445032 valgrind/memcheck crash with SIGSEGV when SIGVTALRM timer used and libthr.so associated The problem was that 'struct sigframe' has both a uContext struct member and a puContext pointer to that struct. And puContext wasn't being initialized to point to uContext. It seems that the pthread sigreturn code uses puContext on i386. amd64, with register arguments, didn't have this problem. --- diff --git a/NEWS b/NEWS index 888f07bb6b..c6e9361a14 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,8 @@ are not entered into bugzilla tend to get forgotten about or ignored. 444571 PPC, fix the lxsibzx and lxsihzx so they only load their respective sized data. 444836 PPC, pstq instruction for R=1 is not storing to the correct address. +445032 valgrind/memcheck crash with SIGSEGV when SIGVTALRM timer used and + libthr.so associated To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_sigframe/sigframe-x86-freebsd.c b/coregrind/m_sigframe/sigframe-x86-freebsd.c index a1d8638e5a..12f51e385c 100644 --- a/coregrind/m_sigframe/sigframe-x86-freebsd.c +++ b/coregrind/m_sigframe/sigframe-x86-freebsd.c @@ -304,6 +304,8 @@ static Addr build_sigframe(ThreadState *tst, err = 0; } + frame->puContext = (Addr)&frame->uContext; + synth_ucontext(tst->tid, siginfo, trapno, err, mask, &frame->uContext, &frame->fpstate);