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).
Created attachment 36806 [details] test program for client requests providing "delta leak search"
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)
Fixed with the commit Rev 11838 (cfr bug 214909)