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 775986 - gnome-shell crashes when exiting weston-flower from menu
gnome-shell crashes when exiting weston-flower from menu
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2016-12-12 14:29 UTC by Adam Goode
Modified: 2017-01-02 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Ensure we don't focus xdg_popups iff they're non-grabbing (3.28 KB, patch)
2016-12-12 19:08 UTC, Rui Matos
committed Details | Review

Description Adam Goode 2016-12-12 14:29:37 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=1403556

How to reproduce:
1. Build weston-flower
2. Run it
3. Right click on weston-flower and select exit

SIGABRT

 #4 meta_window_unmanage at core/window.c:1389
 #5 meta_wayland_surface_destroy_window at wayland/meta-wayland-surface.c:408
 #6 xdg_toplevel_destructor at wayland/meta-wayland-xdg-shell.c:165
 #7 destroy_resource at src/wayland-server.c:611
 #8 wl_resource_destroy at src/wayland-server.c:626
 #9 meta_wayland_xdg_surface_shell_client_destroyed at wayland/meta-wayland-xdg-shell.c:1429
 #10 xdg_shell_destructor at wayland/meta-wayland-xdg-shell.c:1877
 #11 destroy_resource at src/wayland-server.c:611
 #12 for_each_helper at src/wayland-util.c:373
 #13 wl_map_for_each at src/wayland-util.c:386
Comment 1 Adam Goode 2016-12-12 14:30:25 UTC
mutter:ERROR:core/window.c:1389:meta_window_unmanage: assertion failed: (window->display->focus_window != window)
Comment 2 Rui Matos 2016-12-12 19:08:05 UTC
Created attachment 341841 [details] [review]
wayland: Ensure we don't focus xdg_popups iff they're non-grabbing

Commit 4295fdb892d4474b68e98aa783b725f99c1a2d3a made us skip focusing
all xdg_popups instead of just non-grabbing ones as intended. This
means that when unmanaging a window we might select a xdg_popup window
to focus (in meta_stack_get_default_focus_window() ) but then since we
don't actually focus it we go on unmanaging the focused window which
triggers an assertion, as it should.

To avoid this and still fixing bug 771694 we can make use of the
MetaWindow->input property for non-grabbing xdg_popup windows since
their semantics, in this regard, are the same as no input X11 windows.

This way, when unmanaging a focused window while a xdg_popup is up,
we'll either give focus to the xdg_popup or not select the popup at
all to be focused if it's non-grabbing.
Comment 3 Rui Matos 2016-12-12 19:10:05 UTC
Olivier, can you take a loot at this and let me know if the issue in bug 771694 remains fixed?
Comment 4 Olivier Fourdan 2016-12-13 07:56:49 UTC
I can reliably crash mutter with an assert() failed using the "Details" button in test-completion:

1. Run gtksourceview test-completion

   WAYLAND_DISPLAY=wayland-1 jhbuild run  ~/.cache/jhbuild/build/gtksourceview/tests/test-completion

2. Start typing a few characters until the completion widget appears
3. Navigate to some item in the list, and click on "Details", the detail window appears
4. Click again on Details to hide the detail popup

=> mutter will die with an assert() failed:

mutter/src/wayland/meta-wayland-surface.c:1183:update_surface_output_state: assertion failed: (surface->role)

  • #0 __GI_raise
    at ../sysdeps/unix/sysv/linux/raise.c line 58
  • #1 __GI_abort
    at abort.c line 89
  • #2 g_assertion_message
  • #3 g_assertion_message_expr
    at /home/ofourdan/src/gnome/glib/glib/gtestutils.c line 2456
  • #4 update_surface_output_state
    at /home/ofourdan/src/gnome/mutter/src/wayland/meta-wayland-surface.c line 1183
  • #5 g_hash_table_foreach
    at /home/ofourdan/src/gnome/glib/glib/ghash.c line 1608
  • #6 g_closure_invoke
    at /home/ofourdan/src/gnome/glib/gobject/gclosure.c line 804
  • #7 signal_emit_unlocked_R
    at /home/ofourdan/src/gnome/glib/gobject/gsignal.c line 3635
  • #8 g_signal_emit_valist
    at /home/ofourdan/src/gnome/glib/gobject/gsignal.c line 3391
  • #9 g_signal_emit
    at /home/ofourdan/src/gnome/glib/gobject/gsignal.c line 3447
  • #10 g_object_dispatch_properties_changed
    at /home/ofourdan/src/gnome/glib/gobject/gobject.c line 1064
  • #11 g_object_notify_by_spec_internal
    at /home/ofourdan/src/gnome/glib/gobject/gobject.c line 1157
  • #12 g_object_notify_by_pspec
    at /home/ofourdan/src/gnome/glib/gobject/gobject.c line 1267
  • #13 clutter_actor_real_unmap
    at /home/ofourdan/src/gnome/mutter/clutter/clutter/clutter-actor.c line 1607
  • #14 clutter_actor_set_mapped
    at /home/ofourdan/src/gnome/mutter/clutter/clutter/clutter-actor.c line 1283
  • #15 clutter_actor_update_map_state
    at /home/ofourdan/src/gnome/mutter/clutter/clutter/clutter-actor.c line 1457
  • #16 clutter_actor_real_unmap
    at /home/ofourdan/src/gnome/mutter/clutter/clutter/clutter-actor.c line 1593
  • #17 clutter_actor_set_mapped
    at /home/ofourdan/src/gnome/mutter/clutter/clutter/clutter-actor.c line 1283
  • #18 clutter_actor_update_map_state
    at /home/ofourdan/src/gnome/mutter/clutter/clutter/clutter-actor.c line 1457
  • #19 clutter_actor_real_hide
    at /home/ofourdan/src/gnome/mutter/clutter/clutter/clutter-actor.c line 1832
  • #20 g_closure_invoke
    at /home/ofourdan/src/gnome/glib/gobject/gclosure.c line 804
  • #21 signal_emit_unlocked_R
    at /home/ofourdan/src/gnome/glib/gobject/gsignal.c line 3565
  • #22 g_signal_emit_valist
    at /home/ofourdan/src/gnome/glib/gobject/gsignal.c line 3391
  • #23 g_signal_emit
    at /home/ofourdan/src/gnome/glib/gobject/gsignal.c line 3447
  • #24 clutter_actor_hide
    at /home/ofourdan/src/gnome/mutter/clutter/clutter/clutter-actor.c line 1893
  • #25 meta_window_actor_after_effects
    at /home/ofourdan/src/gnome/mutter/src/compositor/meta-window-actor.c line 1123
  • #26 meta_window_actor_effect_completed
    at /home/ofourdan/src/gnome/mutter/src/compositor/meta-window-actor.c line 1200
  • #27 meta_plugin_manager_event_simple
    at /home/ofourdan/src/gnome/mutter/src/compositor/meta-plugin-manager.c line 195
  • #28 start_simple_effect
    at /home/ofourdan/src/gnome/mutter/src/compositor/meta-window-actor.c line 1101
  • #29 meta_window_actor_hide
    at /home/ofourdan/src/gnome/mutter/src/compositor/meta-window-actor.c line 1361
  • #30 meta_compositor_hide_window
    at /home/ofourdan/src/gnome/mutter/src/compositor/compositor.c line 790
  • #31 meta_window_unmanage
    at /home/ofourdan/src/gnome/mutter/src/core/window.c line 1312
  • #32 meta_wayland_surface_destroy_window
    at /home/ofourdan/src/gnome/mutter/src/wayland/meta-wayland-surface.c line 409
  • #33 wl_surface_destructor
    at /home/ofourdan/src/gnome/mutter/src/wayland/meta-wayland-surface.c line 1242
  • #34 destroy_resource
    at /home/ofourdan/src/gnome/wayland/src/wayland-server.c line 611
  • #35 wl_resource_destroy
    at /home/ofourdan/src/gnome/wayland/src/wayland-server.c line 626
  • #36 ffi_call_unix64
    from /lib64/libffi.so.6
  • #37 ffi_call
    from /lib64/libffi.so.6
  • #38 wl_closure_invoke
    at /home/ofourdan/src/gnome/wayland/src/connection.c line 935
  • #39 wl_client_connection_data
    at /home/ofourdan/src/gnome/wayland/src/wayland-server.c line 371
  • #40 wl_event_loop_dispatch
    at /home/ofourdan/src/gnome/wayland/src/event-loop.c line 423
  • #41 wayland_event_source_dispatch
    at /home/ofourdan/src/gnome/mutter/src/wayland/meta-wayland.c line 79
  • #42 g_main_dispatch
    at /home/ofourdan/src/gnome/glib/glib/gmain.c line 3203
  • #43 g_main_context_dispatch
    at /home/ofourdan/src/gnome/glib/glib/gmain.c line 3856
  • #44 g_main_context_iterate
    at /home/ofourdan/src/gnome/glib/glib/gmain.c line 3929
  • #45 g_main_loop_run
    at /home/ofourdan/src/gnome/glib/glib/gmain.c line 4125
  • #46 meta_run
    at /home/ofourdan/src/gnome/mutter/src/core/main.c line 572
  • #47 main
    at /home/ofourdan/src/gnome/mutter/src/core/mutter.c line 85

Comment 5 Olivier Fourdan 2016-12-13 08:10:00 UTC
(In reply to Olivier Fourdan from comment #4)
> I can reliably crash mutter with an assert() failed using the "Details"
> button in test-completion:

Right, I reverted the patch and it crashes the same , so it's a different issue unrelated to your patch.
Comment 6 Jonas Ådahl 2016-12-13 08:12:54 UTC
(In reply to Olivier Fourdan from comment #4)
> I can reliably crash mutter with an assert() failed using the "Details"
> button in test-completion:
> 
> 1. Run gtksourceview test-completion
> 
>    WAYLAND_DISPLAY=wayland-1 jhbuild run 
> ~/.cache/jhbuild/build/gtksourceview/tests/test-completion
> 
> 2. Start typing a few characters until the completion widget appears
> 3. Navigate to some item in the list, and click on "Details", the detail
> window appears
> 4. Click again on Details to hide the detail popup
> 
> => mutter will die with an assert() failed:
> 
> mutter/src/wayland/meta-wayland-surface.c:1183:update_surface_output_state:
> assertion failed: (surface->role)

This seems unrelated. Looks like we should disconnect the MetaSurfaceActor::mapped" signal earlier in destruct so that we don't try to deal with being unmapped on destruction.
Comment 7 Jonas Ådahl 2016-12-13 08:14:29 UTC
Review of attachment 341841 [details] [review]:

I think the (moved) comment is unnecessary, and documenting it in the commit message I think is enough. Either way, yes, I think we at least for now leave non-grabbing popup not take input (execept pointer/touch input), so looks good to me.
Comment 8 Olivier Fourdan 2016-12-13 08:17:53 UTC
Filed bug 776036 as a follow-up for the failure in comment 4

As for attachment 341841 [details] [review], afaict it works, doesn't cause a regression wrt bug 771694
Comment 9 Rui Matos 2016-12-13 14:16:44 UTC
Attachment 341841 [details] pushed as c98d544 - wayland: Ensure we don't focus xdg_popups iff they're non-grabbing
Comment 10 Christian Stadelmann 2016-12-19 20:45:16 UTC
Will this patch also fix https://bugzilla.redhat.com/show_bug.cgi?id=1406149 ?
Comment 11 Olivier Fourdan 2017-01-02 13:33:54 UTC
(In reply to Christian Stadelmann from comment #10)
> Will this patch also fix https://bugzilla.redhat.com/show_bug.cgi?id=1406149
> ?

I doubt it, the stack in the downstream Red Hat bug 1406149 points toward X11 more than Wayland, to be sure I would need to reproduce but unfortunately I cannot because the search dialog in eclipse is modal.