Ooodles of sexy new valgrind warnings

Maarten Lankhorst m.b.lankhorst at
Mon May 26 19:15:20 CDT 2008

2008/5/25 Dan Kegel <dank at>:
> 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.

> is a roadmap of where the sexy new stuff is; the details
> are in
> 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,
> 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)
This particular kind of bug happens when you use a string function
like strdup to allocate some memory, then try to free it with
HeapFree. The proper fix would be to use HeapAlloc.

None the less valgrind's new logs are very useful as it now reports
almost all invalid uses of Free() with a very low false positive
count. For those who haven't tried valgrind before: try it, it's great
for finding a lot of memory related bugs. You'll probably need the svn
version since the last stable release had some bugs that wine would be
affected by.


More information about the wine-devel mailing list