Hi,
I've been trying to track down a crash in our application for a few days now and I'm wondering if anyone can help.
I've isolated a crash to a single line of code, the wglflush() call in dlls/wined3d/drawprim.c. Using the current git of wine (1.1.42 + april 5th 2010 commits) with no alterations the application seems rock solid, it won't crash -- but it runs at around 20 fps or so on our test platform.
By commenting the wglflush call in dlls/wined3d/drawprim.c (there is only one call in that file to wglflush) the game's fps triples to 60, but the application will crash if you spin around too quickly or cause a level transition. GDB tells me the crash is in dlls/ntdll/heap.c:RtlAllocateHeap -- I don't think this is heap corruption though because neither guardmalloc nor valgrind report any unexpected memory problems while the crash still occurs using either of those tools.
Wine's debug output is not helpful, the game is killed when the crash happens, no stack trace. The last line is always: err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0xsomethin-different-each-time. I've tried different debug channels but none give any more useful information. The one that might be helpful, trace+heap, seems to prevent the crash when it is turned on but causes fps to cut in half.
Our test platform is a late 2009 macbook pro, 2.53ghz intel core 2 duo, 4gb ram, OSX 10.6.3, Nvidia geforce 9600m gt/512mb video ram. Note that the same behavior has been observed on every mac with tested with, including ATI based imacs and older nvidia 8800 macbooks.
My best guess at this point is that this crash is related to video memory or system->video buffer memory. I've been using the nvidia driver profiler to track this. If I have the wglflush go through only every 3rd frame instead of every frame (using a static call counter) then the video memory usage goes way up, fps goes up and the crashing becomes more frequent.
Can anyone explain the relationship between this wglflush, video memory usage and fps? Why does this one function call have such a dramatic effect on our application?
Thank you.
Wine and OSX, help tracking down a crash
Wine and OSX, help tracking down a crash
On Mon, 2010-04-05 at 16:52 -0500, Elanz wrote:
Martin
Are you sure this isn't thread related?My best guess at this point is that this crash is related to video
memory or system->video buffer memory. I've been using the nvidia
driver profiler to track this. If I have the wglflush go through only
every 3rd frame instead of every frame (using a static call counter)
then the video memory usage goes way up, fps goes up and the crashing
becomes more frequent.
Martin
Update -- After more testing it turns out that the crash I'm noticing can happen using latest git with no code alterations. I've wrote it up in this bug:
http://bugs.winehq.org/show_bug.cgi?id=22301
I see this crash in every version of wine back to 1.1.36, version older than that throw a thread deadlock exception instead of a page fault exception under the same conditions. I tested all the way back to 1.1.25 and then stopped testing older builds to focus on the newer builds again.
http://bugs.winehq.org/show_bug.cgi?id=22301
I see this crash in every version of wine back to 1.1.36, version older than that throw a thread deadlock exception instead of a page fault exception under the same conditions. I tested all the way back to 1.1.25 and then stopped testing older builds to focus on the newer builds again.
Wine and OSX, help tracking down a crash
Elanz wrote:
Have you tried what was suggested in the Applications Database to see if
it clears up the problem?
If not, please input a rating on the game and if you do work on this
program, please nominate yourself as a maintainer.
James McKenzie
Eric:Update -- After more testing it turns out that the crash I'm noticing can happen using latest git with no code alterations. I've wrote it up in this bug:
http://bugs.winehq.org/show_bug.cgi?id=22301
I see this crash in every version of wine back to 1.1.36, version older than that throw a thread deadlock exception instead of a page fault exception under the same conditions. I tested all the way back to 1.1.25 and then stopped testing older builds to focus on the newer builds again.
Have you tried what was suggested in the Applications Database to see if
it clears up the problem?
If not, please input a rating on the game and if you do work on this
program, please nominate yourself as a maintainer.
James McKenzie