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 769387 - X11: Race condition when managing windows
X11: Race condition when managing windows
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2016-08-01 15:27 UTC by Hans Petter Jansson
Modified: 2021-07-05 13:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Mutter verbose log of good/bad manage (187.17 KB, text/plain)
2016-08-01 15:51 UTC, Hans Petter Jansson
  Details
xtrace log (2.14 MB, text/plain)
2016-08-01 15:59 UTC, Hans Petter Jansson
  Details
0001-x11-core-Fix-race-condition-when-managing-windows.patch (6.50 KB, patch)
2016-08-01 16:22 UTC, Hans Petter Jansson
needs-work Details | Review

Description Hans Petter Jansson 2016-08-01 15:27:30 UTC
There is an apparent race condition in the X11 code that sets up a window for management. This manifests with the Oracle database installer and potentially other Java Swing applications, and leads to dialogs getting the wrong size (too small, typically zero internal width or height).

See e.g. http://dba.stackexchange.com/questions/60631/oracle-11g-installation-stuck-at-installation for a screenshot.

This happens whenever the application opens its second dialog in my tests, and it's not possible to resize the dialogs either; there doesn't seem to be any workaround apart from blind keyboard interaction.

I suspect this was introduced with the removal of server grabs in bug 721345.
Comment 1 Hans Petter Jansson 2016-08-01 15:51:53 UTC
Created attachment 332483 [details]
Mutter verbose log of good/bad manage

Verbose log from Mutter. I've marked the point at which I open a dialog successfully with:

========== BEGIN good dialog management ==========

And a dialog that opens at the wrong size with:

========== BEGIN bad dialog management ==========
Comment 2 Hans Petter Jansson 2016-08-01 15:59:59 UTC
Created attachment 332484 [details]
xtrace log

xtrace of client app interaction with X11 on good/bad dialog open.

The first instance of 'My Oracle Support' in a ChangeProperty indicates the first attempt, which is successful. The second instance gets a bad size.
Comment 3 Hans Petter Jansson 2016-08-01 16:22:36 UTC
Created attachment 332486 [details] [review]
0001-x11-core-Fix-race-condition-when-managing-windows.patch

Naïve attempt at a fix. This reintroduces part of the code to support server grabs that was removed in bug 733068, and protects the minimum critical section with a grab. It works around resulting hangs by short-circuiting some of the keybindings code when the server is grabbed.

Unpalatable, but seems to solve the problem.
Comment 4 Hans Petter Jansson 2016-08-01 16:29:02 UTC
I'd like to turn this into a proper fix, but I'm not sure how to proceed. I'm aware that grabs were taken out for a reason, but the manage section looks extremely racey to me.

Thoughts?
Comment 5 Rui Matos 2016-08-10 17:13:34 UTC
This sounds a bit like bug 759492 .

Is this reproducible on git master?
Comment 6 Hans Petter Jansson 2016-08-10 18:44:57 UTC
The grab changes from bug 721345 were introduced on the gnome-3-10 branch just prior to mutter 3.10.3. The bug discussed here was first discovered and patched in SLE 12 with mutter 3.10.4. The latest version I've verified it with is mutter 3.20.3, which has the fix for bug 759492.

I'll see if I can verify it with a more recent version.
Comment 7 Hans Petter Jansson 2016-08-10 20:57:10 UTC
Looks like this'll have to wait at least a week.
Comment 8 GNOME Infrastructure Team 2021-07-05 13:44:57 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/mutter/-/issues/

Thank you for your understanding and your help.