Ooodles of sexy new valgrind warnings
Dan Kegel
dank at kegel.com
Mon May 26 00:13:22 CDT 2008
I updated to the latest valgrind from svn, and
it gives lots of nifty new warnings. e.g. it
warns if you are using the wrong free for a
particular memory block, and it tells you
where uninitialized blocks came from.
http://kegel.com/wine/valgrind/logs-2008-05-25-summary.txt
is a roadmap of where the sexy new stuff is; the details
are in http://kegel.com/wine/valgrind/logs-2008-05-25/
For instance, it says
diff -u logs-2008-05-20/vg-winmm_capture.txt
logs-2008-05-25/vg-winmm_capture.txt
+ Uninitialised value was created by a client request
+ Mismatched free() / delete / delete []
Pulling up just that diff,
http://kegel.com/wine/valgrind/logs-2008-05-25/vg-winmm_capture-diff.txt
shows the latter error is
+ Mismatched free() / delete / delete []
+ at RtlFreeHeap (heap.c:1287)
+ by wave_in_test_device (capture.c:397)
+ by func_capture (capture.c:716)
+ by run_test (test.h:414)
+ by main (test.h:463)
+ Address 0x440cc90 is 0 bytes inside a block of size 14 alloc'd
+ at malloc (vg_replace_malloc.c:207)
+ by wave_in_test_device (capture.c:388)
+ by func_capture (capture.c:716)
+ by run_test (test.h:414)
+ by main (test.h:463)
Sure enough, memory is allocate with strdup() and freed with HeapFree(), tsk.
Anyway, there's plenty here for everybody. Pile on!
Tomorrow I'll start running these without -O2;
Zac Brown reminded me that gives better stack tracebacks
(i.e. it inhibits inlining, which often causes small static
functions to disappear from the stack dumps in valgrind's error messages).
- Dan
More information about the wine-devel
mailing list