http://bugs.winehq.org/show_bug.cgi?id=10610
Summary: Gothic II: D3D7 crash after playing several minutes Product: Wine Version: 0.9.49. Platform: PC-x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-directx-d3d AssignedTo: wine-bugs@winehq.org ReportedBy: wielkiegie@gmail.com
Created an attachment (id=9411) --> (http://bugs.winehq.org/attachment.cgi?id=9411) Wine messages when game crashes
On Wine 0.9.49 (and probably all after 0.9.38) Direct3D 7 crashes after playing several (7-10) minutes Gothic II: Night of the Raven (and probably base Gothic II and Gothic I).
http://bugs.winehq.org/show_bug.cgi?id=10610
Stefan Dösinger stefandoesinger@gmx.at changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |stefandoesinger@gmx.at
--- Comment #1 from Stefan Dösinger stefandoesinger@gmx.at 2007-11-30 08:57:15 --- Hmm, propably some code in wined3d is doing GDI calls while holding the X11 lock
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #2 from Gustaw Smolarczyk wielkiegie@gmail.com 2007-11-30 09:04:17 --- Additionally, I've got some details about this. The crash is in dlls/wined3d/surface.c:55 : if (GL_SUPPORT(ARB_MULTITEXTURE)) { GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB)); checkGLcall("glActiveTextureARB"); }
Backtrace: IDirectDrawSurfaceImpl_Lock -> IWineD3DSurface[Impl]_LockRect -> IWineD3DSurface[Impl]_LoadLocation -> surface_download_data
In the last function execution hangs when calling OpenGL API function. There is no problem in Wine 0.9.38, but there is no similar code in dlls/wined3d/surface.c.
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #3 from Stefan Dösinger stefandoesinger@gmx.at 2007-11-30 09:17:36 --- Good catch
A few lines above, there's this code:
if(myDevice->createParms.BehaviorFlags & WINED3DCREATE_MULTITHREADED) { ActivateContext(myDevice, myDevice->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); }
Can you remove the check of the behavior flags, so that the ActivateContext call is executed unconditionally?
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #4 from Gustaw Smolarczyk wielkiegie@gmail.com 2007-11-30 09:50:11 --- The game seems to work properly. I play 15min+ and there is no crash anymore. I'll test it better.
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #5 from Vitaliy Margolen vitaliy@kievinfo.com 2007-11-30 10:40:12 --- I see we use this flag in few other places. Should it be removed too? Especially the place like IWineD3DDeviceImpl_EndScene?
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #6 from Stefan Dösinger stefandoesinger@gmx.at 2007-11-30 12:17:05 --- Should be removed in other places as well, but it needs a closer look
http://bugs.winehq.org/show_bug.cgi?id=10610
Dimitri Nüscheler d1m1@gmx.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |d1m1@gmx.ch
--- Comment #7 from Dimitri Nüscheler d1m1@gmx.ch 2007-12-02 08:49:50 --- This bug seems to be related to http://bugs.winehq.org/show_bug.cgi?id=9843
Removing the check for these behaviour flags make me unable to reproduce Bug 9843 (solves the problem) in Gothic 1.
http://bugs.winehq.org/show_bug.cgi?id=10610
Tobias Lieske samusin@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #8 from Tobias Lieske samusin@gmx.net 2007-12-02 13:28:02 --- *** This bug has been confirmed by popular vote. ***
http://bugs.winehq.org/show_bug.cgi?id=10610
Tobias Lieske samusin@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |samusin@gmx.net
--- Comment #9 from Tobias Lieske samusin@gmx.net 2007-12-03 08:49:29 --- so if i comment out that line in surface.c and recompile it should work? or do i have to comment out more lines? in more files?
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #10 from Gustaw Smolarczyk wielkiegie@gmail.com 2007-12-03 10:14:31 --- You should comment those line like that:
/*if(myDevice->createParms.BehaviorFlags & WINED3DCREATE_MULTITHREADED)*/ { ActivateContext(myDevice, myDevice->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); }
And after recompiling this dll Gothic (II) should work properly. I don't know that it is correct solution for all games, but I haven't found any problem.
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #11 from Stefan Dösinger stefandoesinger@gmx.at 2007-12-03 10:41:37 --- The fix is correct from what it does. Something like that can be sent to wine-patches, just removing the entire block rather than commenting it out. It will not cause any direct breakage in other games, but it can have a small effect on performance(which is is unmeasurable most likely).
The idea behind the check for this flag is that everywhere it is checked, there MUST be a properly set up context already, unless the calling thread changed. Direct3D apps are supposed to set the MULTITHREADED flag when they are going to call d3d methods from different threads. Many games however do not do that. Consequently, they have to expect breakage on Windows as well.
The difference between Windows and Wine in this area is that the way the direct3d driver works, the only possible negative effect of not setting the flags are race conditions. Race conditions are nasty, but the games can be lucky, and usually they are lucky all the time. On OpenGL, the same situation causes a crash. So the game is lucky 0% of the time.
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #12 from Tobias Lieske samusin@gmx.net 2007-12-04 10:54:52 --- so when i delete the whole block: if(myDevice->createParms.BehaviorFlags & WINED3DCREATE_MULTITHREADED) { ActivateContext(myDevice, myDevice->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); } i get the error anyway but if just comment it like gustaw said i dont get the error at least not till now but i didnt have the time to play for a long time but i think the error would have occured because it was about 20-30 mins i played without error. so i have to say good work gustaw! you rock :D
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #13 from Gustaw Smolarczyk wielkiegie@gmail.com 2007-12-04 11:28:26 --- You shouldn't delete block, but change it to something like:
ActivateContext(myDevice, myDevice->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
So you should delete only `if' expression and brackets around `ActiveContext' function call. If the whole block is deleted then the crash still occurs, even if application has set MULTTHREADED flag.
http://bugs.winehq.org/show_bug.cgi?id=10610
juergenw_@freenet.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |juergenw_@freenet.de
--- Comment #14 from juergenw_@freenet.de 2008-01-02 14:33:42 --- I had very similar crashes with Gothic 1 & wine-0.9.52 (ddraw_cs timed out, blocked threads) after only a few minutes of gameplay. After removing the conditioned check but leaving the instruction, as supposed here, I could play it for more than 2 hours without receiving any crash.
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #15 from knan-wine@anduin.net 2008-01-25 18:07:18 --- Fix is in 0.9.53. Retest & close?
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #16 from juergenw_@freenet.de 2008-01-26 15:24:34 --- Quite difficult to achieve a retest, as Gothic/2 crashes right at start since wine-0.9.53(and 54) with below unimplemented ntoskrnl function, at least on my FC7 system:
wine: Call from 0x7b8414b0 to unimplemented function ntoskrnl.exe.IoCompleteRequest, aborting wine: Unimplemented function ntoskrnl.exe.IoCompleteRequest called at address 0x7b8414b0 (thread 001b), starting debugger... Unhandled exception: unimplemented function ntoskrnl.exe.IoCompleteRequest called in 32-bit code (0x7b841528).
This may be related to the below fixme at the end the wine build process: fixme:ntoskrnl:KeInitializeTimerEx 0x110ad8 0
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #17 from Gustaw Smolarczyk wielkiegie@gmail.com 2008-01-27 02:35:04 --- I think, that it's because of better implementation of ntoskrnl.exe. Game thinks that it's running good (there is less stubs) and tries to execute stub function (IoCompleteRequest). However I haven't got newest wine source to check that.
http://bugs.winehq.org/show_bug.cgi?id=10610
Nils Larsson nisselarsson@home.se changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nisselarsson@home.se
--- Comment #18 from Nils Larsson nisselarsson@home.se 2008-03-10 15:48:22 --- Running Gothic2.exe gives me an unhandled page fault almost instantly with no apparent useful information from wine. Running Spacer2.exe (also in system/) does the same but spouts out: wine: Call from 0x7ee50f60 to unimplemented function ntoskrnl.exe.IoConnectInterrupt, aborting wine: Call from 0x7ee50f60 to unimplemented function ntoskrnl.exe.IoCreateController, aborting
I'm assuming Spacer2.exe is run at some point by Gothic2.exe. I should note that this is a No-CD crack and I assume some trickery is involved. Running without a crack is impossible due to bug #9216.
Would a WINEDEBUG=+something help?
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #19 from Matthias funny.hangman@gmx.net 2008-03-12 13:19:26 --- Created an attachment (id=11341) --> (http://bugs.winehq.org/attachment.cgi?id=11341) wine output
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #20 from Lei Zhang thestig@google.com 2008-03-12 13:22:02 --- (In reply to comment #19)
Created an attachment (id=11341)
--> (http://bugs.winehq.org/attachment.cgi?id=11341) [details]
wine output
Looks like the crash is inside the ATI driver.
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #21 from Stefan Dösinger stefandoesinger@gmx.at 2008-03-12 14:12:37 --- Yes, that's apparently a crash due to multithreaded d3d. You'll have to bug ATI about that
http://bugs.winehq.org/show_bug.cgi?id=10610
--- Comment #22 from Austin English austinenglish@gmail.com 2008-06-12 13:10:02 --- Is this still an issue in current (1.0-rc4 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=10610
Matthias funny.hangman@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |funny.hangman@gmx.net
--- Comment #23 from Matthias funny.hangman@gmx.net 2008-06-13 01:12:04 --- I test it with Wine 1.0-rc4; the bug seems to be fixed great work ;)
http://bugs.winehq.org/show_bug.cgi?id=10610
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #24 from Dmitry Timoshkov dmitry@codeweavers.com 2008-06-13 01:24:22 --- Reporetd fixed.
http://bugs.winehq.org/show_bug.cgi?id=10610
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #25 from Alexandre Julliard julliard@winehq.org 2008-06-13 10:45:05 --- Closing bugs fixed in 1.0-rc5.
http://bugs.winehq.org/show_bug.cgi?id=10610
Hazem Kassabji hazem.kassabji@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hazem.kassabji@gmail.com