https://bugs.winehq.org/show_bug.cgi?id=47392
Bug ID: 47392 Summary: Drakensang Online crashes when exiting fullscreen Product: Wine Version: 4.10 Hardware: x86 URL: https://www.drakensang.com/en OS: Linux Status: NEW Keywords: download Severity: normal Priority: P2 Component: directx-d3d Assignee: wine-bugs@winehq.org Reporter: z.figura12@gmail.com Distribution: ---
It calls IDirect3DDevice9::SetCursorProperties() to change the cursor. As a result the current cursor (struct wined3d_device.cursor_texture) is destroyed. Meanwhile, on the CSMT thread, swapchain_gl_present() checks for wined3d_device.cursor_texture, finds it to exist, then attempts to blit from the texture to the backbuffer, and crashes trying to access it, because it has been set to NULL in the meantime.
The fact that this is inherently a race means that probably the crash is intermittent, or takes different forms. Still, it's clear enough that there is some form of missing synchronization. I don't know enough about the context to guess what that should be.
https://bugs.winehq.org/show_bug.cgi?id=47392
--- Comment #1 from Józef Kucia joseph.kucia@gmail.com --- A simple fix could be to put
wined3d_cs_finish(device->cs, WINED3D_CS_QUEUE_DEFAULT);
at the beginning of wined3d_device_set_cursor_properties(). It might be not very good for performance reasons if wined3d_device_set_cursor_properties() is called often.
Other way to fix the problem is to send wined3d_device_set_cursor_properties() through the command stream.
https://bugs.winehq.org/show_bug.cgi?id=47392
--- Comment #2 from Henri Verbeet hverbeet@gmail.com --- (In reply to Józef Kucia from comment #1)
Other way to fix the problem is to send wined3d_device_set_cursor_properties() through the command stream.
Perhaps it's easier than that though. Texture destruction goes through the CS, so even though device->cursor_texture may be NULL, the actual texture hasn't been destroyed at that point. It may be worth a try to just store swapchain->device->cursor_texture in a local variable, which is perhaps not a bad idea regardless. (The issue of "bCursorVisible" and "hardwareCursor" needing to be consistent with "cursor_texture" would remain of course, but that's easy enough to fix.)
https://bugs.winehq.org/show_bug.cgi?id=47392
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED Fixed by SHA1| |d601fd92347fd2032f1e7866ddb | |a661566090674
--- Comment #3 from Zebediah Figura z.figura12@gmail.com --- This is fixed by https://source.winehq.org/git/wine.git/commitdiff/d601fd92347fd2032f1e7866ddba661566090674, using Henri's suggested approach.
https://bugs.winehq.org/show_bug.cgi?id=47392
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.12.