http://bugs.winehq.org/show_bug.cgi?id=30850
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase URL|http://www.gigasoft.com/PE7 | |-Pro-Setup.exe | Summary|Heap problem when running |Invalid valgrind warnings |Gigasoft ProEssentials |after HeapReAlloc |graph component? |
--- Comment #4 from Dan Kegel dank@kegel.com 2012-06-09 21:43:45 CDT --- Here's an even smaller testcase:
#include <windows.h>
int main(int argc, char **argv) { void *p, *q, *r; p = HeapAlloc(GetProcessHeap(), 0, 8100); // Commenting out HeapReAlloc avoids valgrind warning q = HeapReAlloc(GetProcessHeap(), 0, p, 4100); // This heap operation generates spurious warnings under valgrind r = HeapAlloc(GetProcessHeap(), 0, 1234); return *(char *)q; }
so it's pretty clearly a problem in our heap annotations... and happily the problem is obvious: notify_realloc() was called after HEAP_ShrinkBlock in one place, clobbering its annotations. Reversing the order of the calls fixes the problem.
Patch sent, http://www.winehq.org/pipermail/wine-patches/2012-June/114929.html