After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733068 - Fix a deadlock when exiting
Fix a deadlock when exiting
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 704644 733448 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-07-11 17:36 UTC by Owen Taylor
Modified: 2014-11-09 20:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't grab the server when unmanaging the screen (1.36 KB, patch)
2014-07-11 17:36 UTC, Owen Taylor
committed Details | Review
MetaDisplay: remove meta_display_grab()/ungrab() (4.43 KB, patch)
2014-07-11 17:36 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2014-07-11 17:36:07 UTC
These patches fix a deadlock when exiting where we would grab the
frontend connection, then try to make a button grab on the backend
connection. (The lockup was intermittent because the XGrabServer
call might or might not have been flushed to the X server.)
Comment 1 Owen Taylor 2014-07-11 17:36:09 UTC
Created attachment 280522 [details] [review]
Don't grab the server when unmanaging the screen

There's no obvious reason for grabbing the X server when unmanaging
a screen - the only race conditions a server grab solves are those
related to querying and then acting on the results of the query.

Our shutdown sequence is correctly ordered according to the ICCCM -
we first unselect on the root window, and then we destroy the
window owning WM_S<n> so removing the grab should not cause any
problems when we are being replaced with another window manager.
Comment 2 Owen Taylor 2014-07-11 17:36:13 UTC
Created attachment 280523 [details] [review]
MetaDisplay: remove meta_display_grab()/ungrab()

Now that we have two connections to the X server, the idea of a
ref-counted server grab that might be held across extended portions
of code is very dangerous since we might try to use the backend
connection while the frontend connection is grabbed.

Replace the only usage (which was local) with direct
XGrabServer/XUngrabServer usage and remove the meta_display_grab()
API.
Comment 3 Jasper St. Pierre (not reading bugmail) 2014-07-11 17:37:16 UTC
Review of attachment 280523 [details] [review]:

Yep.
Comment 4 Jasper St. Pierre (not reading bugmail) 2014-07-11 17:37:36 UTC
Review of attachment 280522 [details] [review]:

OK.
Comment 5 Owen Taylor 2014-07-11 17:39:49 UTC
Attachment 280522 [details] pushed as 806dabe - Don't grab the server when unmanaging the screen
Attachment 280523 [details] pushed as 88a7790 - MetaDisplay: remove meta_display_grab()/ungrab()
Comment 6 Colin Guthrie 2014-07-20 11:39:41 UTC
*** Bug 733448 has been marked as a duplicate of this bug. ***
Comment 7 Bastien Nocera 2014-11-09 20:25:30 UTC
*** Bug 704644 has been marked as a duplicate of this bug. ***