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 745785 - Crash in meta_window_ungrab_all_keys()
Crash in meta_window_ungrab_all_keys()
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: general
3.14.x
Other Linux
: Normal major
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2015-03-07 11:55 UTC by Milan Bouchet-Valat
Modified: 2021-07-05 13:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't end the grab on a _NET_WM_MOVERESIZE_CANCEL unless there's a grab for the window (1.11 KB, patch)
2015-10-07 01:22 UTC, Owen Taylor
accepted-commit_now Details | Review
Protect against stray calls to meta_display_end_grab_op() (1.10 KB, patch)
2015-10-07 01:22 UTC, Owen Taylor
committed Details | Review

Description Milan Bouchet-Valat 2015-03-07 11:55:06 UTC
Several users have reported this crash on Fedora 21. It looks like it can be reproduced by doing Alt+Tab while in a VM in virt-manager.

The common factor between several users may well be the high load, which may be triggering a race condition.

https://bugzilla.redhat.com/show_bug.cgi?id=1144416

Thread 1 (Thread 0x7fe8ef13fa40 (LWP 1730))

  • #0 meta_window_ungrab_all_keys
    at core/keybindings.c line 1616
  • #1 meta_display_end_grab_op
    at core/display.c line 1914
  • #2 meta_window_x11_client_message
    at x11/window-x11.c line 2511
  • #3 handle_other_xevent
    at x11/events.c line 1460
  • #4 meta_display_handle_xevent
    at x11/events.c line 1727
  • #5 xevent_filter
    at x11/events.c line 1766
  • #6 gdk_event_apply_filters
    at gdkeventsource.c line 81
  • #7 gdk_event_source_translate_event
    at gdkeventsource.c line 195
  • #8 _gdk_x11_display_queue_events
    at gdkeventsource.c line 338
  • #9 gdk_display_get_event
    at gdkdisplay.c line 321
  • #10 gdk_event_source_dispatch
    at gdkeventsource.c line 360
  • #11 g_main_dispatch
    at gmain.c line 3064
  • #12 g_main_context_dispatch
    at gmain.c line 3663
  • #13 g_main_context_iterate
    at gmain.c line 3734
  • #14 g_main_loop_run
    at gmain.c line 3928
  • #15 meta_run
    at core/main.c line 481
  • #16 main
    at main.c line 461

Comment 1 Owen Taylor 2015-10-07 01:22:14 UTC
Created attachment 312785 [details] [review]
Don't end the grab on a _NET_WM_MOVERESIZE_CANCEL unless there's a grab for the window

This prevents crashes when _NET_WM_MOVERESIZE_CANCEL is received, but the grab
in effect is a plugin grab with display->grab_window == NULL.
Comment 2 Owen Taylor 2015-10-07 01:22:20 UTC
Created attachment 312786 [details] [review]
Protect against stray calls to meta_display_end_grab_op()

If end_grab_op() is called when no grab is in effect, just print a
warning and return.
Comment 3 Owen Taylor 2015-10-07 01:26:17 UTC
The problem is pretty clearly a window sending _NET_MOVERESIZE_CANCEL when a plugin grab (so display->grab_window == NULL) is in effect.

Both of these patches should fix the crasher individually, I include both:

 - Because the first also avoids one window ending the grab op on another window
 - Because the second could avoid other crashes in the future

I made the patches silent because meta_display_end_grab_op() has been silent on a stray end_grab_op since forever - but started crashing when a *plugin* grab is in effect when plugin grabs were introduced.
Comment 4 Milan Bouchet-Valat 2015-10-07 06:22:25 UTC
Great! Out of curiosity, what typically creates a plugin grab when using gnome-shell?
Comment 5 Owen Taylor 2015-10-07 12:51:35 UTC
(In reply to Milan Bouchet-Valat from comment #4)
> Great! Out of curiosity, what typically creates a plugin grab when using
> gnome-shell?

 * The alt-Tab switcher (I think, we've done different things)
 * The activities overview
 * The screen lock
 * Modal dialogs
 etc.
Comment 6 Jasper St. Pierre (not reading bugmail) 2015-10-08 15:00:26 UTC
Review of attachment 312786 [details] [review]:

I like this one better.
Comment 7 Owen Taylor 2015-10-12 13:57:17 UTC
Comment on attachment 312786 [details] [review]
Protect against stray calls to meta_display_end_grab_op()

I pushed the one patch (with a fixed up comment), but I think the other
patch is correct as well, though it protects only against a rare misbehavior.

Attachment 312786 [details] pushed as ae7aabd - Protect against stray calls to meta_display_end_grab_op()
Comment 8 Jasper St. Pierre (not reading bugmail) 2015-10-12 15:38:21 UTC
Review of attachment 312785 [details] [review]:

Well, we won't crash anymore, but it does make sense to double-check, just in case an app fires a stray end_grab_op while the user is grabbing another window.
Comment 9 GNOME Infrastructure Team 2021-07-05 13:47:05 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.