Dan Kegel a écrit :
(Without a change like this, Valgrind can't properly detect buffer overruns, but even without Valgrind, this change will improve Wine's ability to detect buffer overruns.)
With this change, users can enable buffer overrun detection in Wine by setting WINE_GLOBAL_FLAGS=0x10. This is like the overrun detection in Windows enabled by setting NtGlobalFlags to 0x10, but checks 16 bytes rather than 8, and works for large allocations, not just small ones.
With this enabled, a remarkable number of tests break.
I'm posting this to wine-devel for review while I add valgrind annotations (which should make it easier to tell whether the errors it detects are real or spurious) and fix the spurious breakages.
Note that this change is a no-op under normal circumstances; without setting WINE_GLOBAL_FLAGS, you shouldn't see any breakage.
Hi Dan
interesting stuff however, you don't handle correctly HeapReAlloc(..., ZERO_MEMORY,...) calls when the already allocated block grows in place
=> you get a block like OGN (O = old block, G=guard for old block, N=new block extension) what's zeroed out is N, whereas you should "repaint" GN into ZG (zero of size(N), Guard) which may also explain lots of errors when running the tool
A+