https://bugs.freedesktop.org/show_bug.cgi?id=29170
Summary: [regression] Far Cry (in Wine) hangs on level load Product: Mesa Version: git Platform: Other OS/Version: All Status: NEW Severity: normal Priority: medium Component: Drivers/DRI/r300 AssignedTo: dri-devel@lists.freedesktop.org ReportedBy: sa@whiz.se
Created an attachment (id=37237) --> (https://bugs.freedesktop.org/attachment.cgi?id=37237) backtrace from hang
The game Far Cry (running in Wine) hangs when a level loads. Bisecting (and confirming by reverting) leads to this commit:
f8d81c31cee30821da3aab331a57f484f6a07a5d is the first bad commit commit f8d81c31cee30821da3aab331a57f484f6a07a5d Author: Nick Bowler nbowler@draconx.ca Date: Wed Jul 14 12:01:49 2010 -0400
dri2: Track event mask in client code.
When direct rendering is being used, DRI2 BufferSwapComplete events are sent unconditionally to clients, even if they haven't been requested. This causes error messages to be printed by every freeglut application of the form
freeglut (./gears): Unknown X event type: 104
and might confuse other clients.
This is a fixed up version of the patch by Jesse Barnes, which drops BufferSwapComplete events if they are not requested by clients.
Fixes fdo bug 27962.
Signed-off-by: Nick Bowler nbowler@draconx.ca Signed-off-by: Jesse Barnes jbarnes@virtuousgeek.org
:040000 040000 43b22479000d40e4034e467746bda73544d1ef4f a7c81f4433d420249b67bee1a16bc047a45141a0 M src
System environment: -- system architecture: 32-bit -- Linux distribution: Debian unstable -- GPU: RV570 -- Model: Asus EAX1950Pro 256MB -- Display connector: DVI -- xf86-video-ati: cdeb1949c820242f05a8897d3ddd0718f204dacf -- xserver: 1.8.99.904 (1.9.0 RC 4) -- mesa: c1cbdbfde0a1f016f9d3f23a39cb7bc0b9825e12 -- drm: 6ea2bda5f5ec8f27359760ce580fdad3df0464df -- kernel: 2.6.35-rc5
https://bugs.freedesktop.org/show_bug.cgi?id=29170
--- Comment #1 from Nick Bowler nbowler@draconx.ca 2010-07-20 10:22:49 PDT --- Created an attachment (id=37248) View: https://bugs.freedesktop.org/attachment.cgi?id=37248 Review: https://bugs.freedesktop.org/review?bug=29170&attachment=37248
Make global GLX mutex recursive.
Sigh. Here's a horrible, horrible hack that should get the game working until someone who understands mesa locking comes up with a better idea.
Looks like if a dri2 context is destroyed while a swap event is pending (seems to happen easily if there are two contexts in one application, maybe it only happens in this case?), we get a deadlock. The garbage collector is called while holding the global glx mutex, which calls XSync, which tries to handle the pending swap event, which tries to take the mutex --> boom.
Looking at the code, it doesn't seem like this is entirely a new problem, either: invalidate events also take the global mutex in DRI2WireToEvent and I imagine they can cause a similar deadlock.
There's nothing radeon-specific about this, every DRI2 driver should be affected.
https://bugs.freedesktop.org/show_bug.cgi?id=29170
--- Comment #2 from Sven Arvidsson sa@whiz.se 2010-07-20 11:08:04 PDT --- (In reply to comment #1)
Sigh. Here's a horrible, horrible hack that should get the game working until someone who understands mesa locking comes up with a better idea.
The patch works fine here, thanks for taking the time to fix this!
There's nothing radeon-specific about this, every DRI2 driver should be affected.
Thanks for confirming, where should it be reassigned to, Mesa core?
https://bugs.freedesktop.org/show_bug.cgi?id=29170
Nick Bowler nbowler@draconx.ca changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|Drivers/DRI/r300 |GLX AssignedTo|dri-devel@lists.freedesktop |mesa-dev@lists.freedesktop. |.org |org
dri-devel@lists.freedesktop.org