Date: Thu, 24 Apr 2014 09:51:11 +0300 From: Mikolaj Golub <to.my.trociny@gmail.com> To: Stanislav Sedov <stas@freebsd.org> Cc: freebsd-hackers@freebsd.org Subject: Re: valgrind on amd64 crashes when delivering signal for threaded application Message-ID: <20140424065110.GB10637@gmail.com> In-Reply-To: <5FDC5FC6-8748-494C-982B-0CEF734BD883@freebsd.org> References: <20140423200135.GA6009@gmail.com> <5FDC5FC6-8748-494C-982B-0CEF734BD883@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 23, 2014 at 11:18:57PM -0700, Stanislav Sedov wrote: > > On Apr 23, 2014, at 1:01 PM, Mikolaj Golub <trociny@freebsd.org> wrote: > > > --- coregrind/m_sigframe/sigframe-amd64-freebsd.c.orig 2014-04-23 22:39:45.000000000 +0300 > > +++ coregrind/m_sigframe/sigframe-amd64-freebsd.c 2014-04-23 22:40:23.000000000 +0300 > > @@ -250,7 +250,7 @@ static Addr build_sigframe(ThreadState * > > UWord err; > > > > rsp -= sizeof(*frame); > > - rsp = VG_ROUNDDN(rsp, 16); > > + rsp = VG_ROUNDDN(rsp, 16) - 8; > > frame = (struct sigframe *)rsp; > > > > if (!extend(tst, rsp, sizeof(*frame))) > > > > Unfortunately, I have poor understanding of valgrind internals and > > what is going on exactly when it delivers a signal to the process, so > > failed to find a proper fix. > > This sounds like a proper solution to me though. Stack handling in valgrind > is indeed convoluted, but it seems in this case it clearly misaligns the stack > as it does not take into account the return address. Any objections if I commit > this fix to valgrind-freebsd? Sure, no objections from my side. Thanks. -- Mikolaj Golub
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140424065110.GB10637>