http://bugs.winehq.org/show_bug.cgi?id=11788
--- Comment #24 from Alexander Dorofeyev alexd4@inbox.lv 2008-04-13 07:18:21 --- (In reply to comment #23)
Created an attachment (id=12112)
--> (http://bugs.winehq.org/attachment.cgi?id=12112) [details]
Crash log with 0.9.59
I just tested this on current git, and the crash is gone! I bisected this and found that the following patch fixes (or hides) the bug:
185157cb6eb25bc5e75e9a260b593e98153d2255 is first bad commit commit 185157cb6eb25bc5e75e9a260b593e98153d2255 Author: Kusanagi Kouichi slash@ma.neweb.ne.jp Date: Fri Apr 4 20:44:36 2008 +0900
winex11: Connect to XIM server dynamically.
That isn't too good. If unrelated commit "fixed" it, it's possible the actual bug just became hidden as it was before, and may reappear later. The problem is sensetive to what code executes before and what it leaves in memory, so even small changes to init code or some routines in wine's dlls etc can hide the problem.
I checked your log - it's apparently the same spot in the program again, so it seems the same problem is still there.
In the Heart Of Winter, the interesting address which decides whether program gets to the problem code or not, is slightly different than in original Icewind Dale: ESP-0x4A9E upon entering WinMain.
Would be interesting to find out why that address is not-zeroed on your machine. Were you successful at getting it to run in IDA? I could provide you some help and guidance if you need it, with running Icewind/HOF in IDA in Wine. If interested, try to find me in irc, #winehackers, my screen name there is frostbite4.
So far I've found that between WinMain and initial entry point ("start") there are some routines called that use quite a lot of stack. At some point there's a GetDC call, that (on my machine) appears to change stack as far as at least 2 memory pages below ESP (as seen at the beginning of WinMain or at 'start' entry point). Perhaps, under certain circumstances, this GetDC call can "pollute" stack up to and including the address which, if non-zeroed, leads to Icewind/HOF crashing.