Bug 345887

Summary: r15034 causes assertion nsegments[segA].kind == SkAnonC at aspacemgr-linux.c:2845 (vgPlain_am_extend_into_adjacent_reservation_client)
Product: [Developer tools] valgrind Reporter: Ivo Raisr <ivosh>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: crash CC: florian, ivosh
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: test case for amd64
test case for x86
proposed patch including test cases

Description Ivo Raisr 2015-04-05 10:23:53 UTC
Created attachment 91894 [details]
test case for amd64

I think r15034 (changes adding VG_(am_is_bogus_client_stack_pointer)())
causes some form of regression in stack extending.

Please see attached test cases for x86/linux and amd64/linux.
On Valgrind r15033 these finish successfully with:
==19090== Process terminating with default action of signal 11 (SIGSEGV)
==19090==  Access not within mapped region at address 0x101
Segmentation fault (core dumped)
(Which is expected behaviour because they test dumping core.)

However on Valgrind r15034 these crash Valgrind with an assertion:
--19128:0: aspacem Valgrind: FATAL: aspacem assertion failed:
--19128:0: aspacem   nsegments[segA].kind == SkAnonC
--19128:0: aspacem   at m_aspacemgr/aspacemgr-linux.c:2845 (vgPlain_am_extend_into_adjacent_reservation_client)
--19128:0: aspacem Exiting now.

The attached test cases are simply built with gcc -m32/-m64.
Comment 1 Ivo Raisr 2015-04-05 10:24:27 UTC
Created attachment 91895 [details]
test case for x86
Comment 2 Ivo Raisr 2015-04-12 19:44:19 UTC
Created attachment 91994 [details]
proposed patch including test cases

Patch fixes regression caused by Valgrind r15034.
VG_(am_is_bogus_client_stack_pointer)() is called prior VG_(extend_stack)()
in signal handling code for thread 1.

Regression test cases for x86-linux and amd64-linux are also part of the patch.
Tested on x86/linux and amd64/linux, everything is ok.
Comment 3 Florian Krohm 2015-04-23 15:21:12 UTC
Thanks for the testcases!
Fixed in r15138
Comment 4 Ivo Raisr 2015-04-24 00:34:00 UTC
Thank you for fixing this!