]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Fix leak scan SEGV catcher when ptr starts in unreadable page (readable for aspacemgr)
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 6 Oct 2013 21:23:04 +0000 (21:23 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 6 Oct 2013 21:23:04 +0000 (21:23 +0000)
commitf5e2186ca798654f6e2764f9d049d22c5d74c241
treeea2730dc798a921c69d907d1b367b83ec6d4fd11
parent3e5f78f04df539906f5f99e84da9c3361c4decbe
Fix leak scan SEGV catcher when ptr starts in unreadable page (readable for aspacemgr)

The fault catcher installed during leak scan to catter e.g. for
possible desynchronisation between real protection and aspacemgr
was not activated when the scanned ptr was directly pointing in
a desynchronised page.
This was (initially only) visible on ppc32 (gcc110) as the page size of
gcc110 is big (64 K).

=> modified the leak-segv-jmp test so as to produce the problem also
on systems with smaller pages.

The fix consists in calling the setjmp before the scan loop,
and skip the bad address which has been recorded by the fault
catcher.
Also, deemed better to just skip one single Addr rather than a full page
(e.g. to skip less data in case some addresses are unreadable e.g.
on strange hardware).

Performance of the leak scan has been measured, seems slightly
faster on x86,amd64 and ppc32. Slightly slower on ppc64.

Also if verbose argument is given, outputs the nr of bytes skipped
due to fault.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13623
memcheck/mc_leakcheck.c
memcheck/tests/leak-segv-jmp.c
memcheck/tests/leak-segv-jmp.stderr.exp