Bug 206802 - patch for client requests for "delta" LEAK_CHECK showing only errors with increase/decrease
Summary: patch for client requests for "delta" LEAK_CHECK showing only errors with inc...
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.5.0
Platform: Unlisted Binaries Linux
: NOR wishlist
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-09 00:11 UTC by philippe.waroquiers
Modified: 2011-06-27 20:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
memcheck patch to implement "delta leak search" client requests (21.07 KB, patch)
2009-09-09 00:11 UTC, philippe.waroquiers
Details
test program for client requests providing "delta leak search" (1.45 KB, text/plain)
2009-09-09 00:14 UTC, philippe.waroquiers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description philippe.waroquiers 2009-09-09 00:11:27 UTC
Created attachment 36805 [details]
memcheck patch to implement "delta leak search" client requests

At work, before using valgrind, we used wdb (hp-ux gdb version) leak search.
wdb has a nice feature that allows to output only "new leaks".
We are using this functionality to search for leaks between "test phases/actions" of a bigger test. This allows to see more precisely which test phase/action is leaking (or allocating, if show-reachable=yes) additional memory.

The attached patch implements two new client requests:
     VALGRIND_DO_ADDED_LEAK_CHECK : only shows the loss record with increased
       nr of bytes or blocks
     VALGRIND_DO_CHANGED_LEAK_CHECK : shows loss records with increase or
          decreased bytes or blocks.
Using such a request gives errors such as:
==21888== 10 (+10) bytes in 1 (+1) blocks are definitely lost in loss record 2 of 3
==21888==    at 0x400591C: malloc (vg_replace_malloc.c:195)
==21888==    by 0x8048541: f (leak-delta.c:14)
==21888==    by 0x8048C37: main (leak-delta.c:61)
==21888== 

So, instead of showing all loss records with absolute nr of bytes/blocks losts,
these new requests will only show the loss records for which there is an increase (or a change) of the nr of bytes/blocks lost (or allocated).
The "unchanged" loss records are not output.
This allows a much easier link between a leak (or memory allocation) and
the test phase producing this leak/memory allocation change.

The regression tests of memcheck have been run with the patch (no new problem).
I will also attach a test program (which must be run as:
   valgrind --leak-check=full --show-reachable=yes leak-delta

If this will be integrated in valgrind, I can then provide patches for
the NEWS file + user manual (basically, would be the above text).
Comment 1 philippe.waroquiers 2009-09-09 00:14:30 UTC
Created attachment 36806 [details]
test program for client requests providing "delta leak search"
Comment 2 Philippe Waroquiers 2010-03-28 22:22:21 UTC
Note that a slightly improved version of this patch has been included
in the patch for bug 214909
(the difference is that the increase/decrease is also reported in the summary)
Comment 3 philippe.waroquiers 2011-06-27 20:32:48 UTC
Fixed with the commit Rev 11838 (cfr bug 214909)