|
From: <sv...@va...> - 2008-05-29 12:30:52
|
Author: sewardj
Date: 2008-05-29 13:30:58 +0100 (Thu, 29 May 2008)
New Revision: 8146
Log:
Merge r8144 (partial fix for mc_leakcheck.c:698 assert)
Modified:
branches/VALGRIND_3_3_BRANCH/memcheck/mc_leakcheck.c
Modified: branches/VALGRIND_3_3_BRANCH/memcheck/mc_leakcheck.c
===================================================================
--- branches/VALGRIND_3_3_BRANCH/memcheck/mc_leakcheck.c 2008-05-29 12:28:51 UTC (rev 8145)
+++ branches/VALGRIND_3_3_BRANCH/memcheck/mc_leakcheck.c 2008-05-29 12:30:58 UTC (rev 8146)
@@ -692,10 +692,22 @@
tl_assert( lc_shadows[i]->data <= lc_shadows[i+1]->data);
}
- /* Sanity check -- make sure they don't overlap */
+ /* Sanity check -- make sure they don't overlap. But do allow
+ exact duplicates. If this assertion fails, it may mean that the
+ application has done something stupid with
+ VALGRIND_MALLOCLIKE_BLOCK client requests, specifically, has
+ made overlapping requests (which are nonsensical). Another way
+ to screw up is to use VALGRIND_MALLOCLIKE_BLOCK for stack
+ locations; again nonsensical. */
for (i = 0; i < lc_n_shadows-1; i++) {
- tl_assert( lc_shadows[i]->data + lc_shadows[i]->szB
- <= lc_shadows[i+1]->data );
+ tl_assert( /* normal case - no overlap */
+ (lc_shadows[i]->data + lc_shadows[i]->szB
+ <= lc_shadows[i+1]->data )
+ ||
+ /* degenerate case: exact duplicates */
+ (lc_shadows[i]->data == lc_shadows[i+1]->data
+ && lc_shadows[i]->szB == lc_shadows[i+1]->szB)
+ );
}
if (lc_n_shadows == 0) {
|