"Martin Profittlich" martin.profittlich@gmx.de writes:
Hello,
when trying to fix an issue with Guitar Rig 3 on Wine (Bug 10129, "Guitar Rig 3 crashes"), I found out something odd: The crash is affected by the size of the SUBHEAP structure in dlls/ntdll/heap.c. Just by adding 8 unused bytes to SUBHEAP, GR3 does not crash anymore. Add another 8 bytes, GR3 crashes again, yet another 8 bytes - no crash and so on.
The bug surfaced with this commit:
[1d063ae18d990343fc077dcbf650add797924018] ntdll: Remove assumptions that the subheap is at the beginning of the memory block.
I don't think the commit is the cause of the problem. It merely changed the size of SUBHEAP to a problematic value.
I don't really understand the inner workings of heap.c. Does anyone have an idea what the cause might be, or where to look for more information?
Probably the app expects some heap block to be 16-byte aligned, and uses MMX vector functions that crash on unaligned data. I guess you need to figure out where the block comes from, and why it would always be aligned on Windows. Maybe it's large enough that Windows allocates it with VirtualAlloc or something like that.