Fix 343173 - helgrind crash during stack unwind
commitc6d07e20b3babfcf54796b6651754ff3d6f2118e
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 3 Mar 2015 22:00:06 +0000 (3 22:00 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 3 Mar 2015 22:00:06 +0000 (3 22:00 +0000)
treeff93dc176bec01b82eab8a69689a1077f99e7265
parentfee9b3cc7652f20e7346932a0b41cdfbd2c1a7bf
Fix 343173 - helgrind crash during stack unwind

This fixes a helgrind crash detected on android.
Android bionic pthread lib unmaps the stack for detached threads
before exiting.
Helgrind tries to unwind the stack to record a 'read' after
the stack unmap, just before the exit syscall.
The unwind then causes a SEGV.

The solution consists in tightening the calculation of
the stack limits, so as to stop unwinding when no valid stack
can be found.
Regression test reproduces the same problem by simulating the
bionic behaviour on linux, using asm similar to bionic lib.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14976
NEWS
coregrind/m_stacks.c
helgrind/tests/Makefile.am
helgrind/tests/stackteardown.c [new file with mode: 0644]
helgrind/tests/stackteardown.stderr.exp [new file with mode: 0644]
helgrind/tests/stackteardown.stdout.exp [new file with mode: 0644]
helgrind/tests/stackteardown.vgtest [new file with mode: 0644]