http://bugs.winehq.org/show_bug.cgi?id=9878
--- Comment #22 from Allan Tong actong88@gmail.com 2007-10-17 00:41:30 --- I find that if I pad the subheap header by 8 bytes, I no longer get the crash. In fact, making sure that the first free block in the subheap is 16 byte aligned seems to fix the issue for me. E.g. padding the subheap header by 8, 24, or 40 bytes fixes the problem, but if I pad by 16 or 32 bytes I still get the crash. FWIW the first free block used to be 16 byte aligned pre-patch.
In my case, there seems to be one heap allocation that's causing the problem. HL2 calls CreateVertexBuffer to create a 2MB buffer in the default memory pool (D3DPOOL_DEFAULT), which as far as I understand means that it should be created in video memory. The current wine implementation ends up creating a 2MB buffer in the process heap. I've found that if I just make sure this one allocation is 16 byte aligned, then I don't get the crash. Is it possible that the game is assuming a 16-byte aligned buffer? Is that normal for a buffer allocated in video memory?