]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix bug in leak search when an ignore range is specified
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Wed, 11 Jul 2012 23:06:07 +0000 (23:06 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Wed, 11 Jul 2012 23:06:07 +0000 (23:06 +0000)
The leak search verifies if an address scanned is in a fully
unaddressable secondary map (64 Kb).
However, the function checking that wrongly verifies
if the address is in an ignore range.
So, if the scan encounters one or more bytes in an ignore
range, the leak scan will erroneously skip the rest of
the 64Kb chunk.

The solution is to not test for ignore range in the function
MC_(is_within_valid_secondary) :
The fact that the address is in an ignore range is in any case
verified in the call to MC_(is_valid_aligned_word), which
is called for every Word just after.

This bug can cause false positive leaks in case small
ignore ranges are specified.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12734

memcheck/mc_main.c

index 5c38c4fa602762f4f4ef8429303621eb26e614a4..57055fb75eb41064c4bae946d13d55d4879ae8e8 100644 (file)
@@ -4644,8 +4644,7 @@ static Int mc_get_or_set_vbits_for_client (
 Bool MC_(is_within_valid_secondary) ( Addr a )
 {
    SecMap* sm = maybe_get_secmap_for ( a );
-   if (sm == NULL || sm == &sm_distinguished[SM_DIST_NOACCESS]
-       || MC_(in_ignored_range)(a)) {
+   if (sm == NULL || sm == &sm_distinguished[SM_DIST_NOACCESS]) {
       /* Definitely not in use. */
       return False;
    } else {