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 759297 - wayland: assertion failed in meta_window_unmanage()
wayland: assertion failed in meta_window_unmanage()
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks: 759161
 
 
Reported: 2015-12-10 12:49 UTC by Olivier Fourdan
Modified: 2016-01-06 18:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Simple reproducer program (2.35 KB, text/plain)
2015-12-10 12:49 UTC, Olivier Fourdan
  Details
window: Re-evaluate window visibility when making it transient (1.15 KB, patch)
2016-01-06 16:26 UTC, Rui Matos
committed Details | Review

Description Olivier Fourdan 2015-12-10 12:49:26 UTC
Created attachment 317109 [details]
Simple reproducer program

Summary:

mutter/gnome-shell will fail on a assertion failed when using the attached reproducer.

The reproducer updates the transient relationship between windows whic hseems to confuse mutter focus handling.

Steps to reproduce:

1. Save and build the attached reproducer
   $ gcc -o testdialog-mutter testdialog-mutter.c `pkg-config --libs --cflags gtk+-3.0`
2. Run the reproducer
3. Iconify one of the normal windows, the two dialogs will hide as well
4. close the other remaining window

Actual result:

mutter aborts with:

mutter:ERROR:core/window.c:1355:meta_window_unmanage: assertion failed: (window->display->focus_window != window)

Program received signal SIGABRT, Aborted.


Expected result:

The app closes and mutter survives

Additional data:

I reckon this is not the same as bug 751715 because the patch attached there attachment 306402 [details] [review] has been merged as commit 6c05eb58 and yet I can still crash mutter with the given reproducer.

gdb shows the following:

0  0x00007fffe9fa2a98 in raise () from /lib64/libc.so.6
  • #1 abort
    from /lib64/libc.so.6
  • #2 g_assertion_message
  • #3 g_assertion_message_expr
    at gtestutils.c line 2452
  • #4 meta_window_unmanage
    at core/window.c line 1355
  • #5 destroy_window
    at wayland/meta-wayland-surface.c line 310
  • #6 xdg_surface_destructor
    at wayland/meta-wayland-surface.c line 1135
  • #7 destroy_resource
    at src/wayland-server.c line 536
  • #8 wl_resource_destroy
    at src/wayland-server.c line 549
  • #9 ffi_call_unix64
    from /lib64/libffi.so.6
  • #10 ffi_call
    from /lib64/libffi.so.6
  • #11 wl_closure_invoke
    at src/connection.c line 937
  • #12 wl_client_connection_data
    at src/wayland-server.c line 338
  • #13 wl_event_loop_dispatch
    at src/event-loop.c line 421
  • #14 wayland_event_source_dispatch
    at wayland/meta-wayland.c line 85
  • #15 g_main_dispatch
    at gmain.c line 3154
  • #16 g_main_context_dispatch
    at gmain.c line 3769
  • #17 g_main_context_iterate
    at gmain.c line 3840
  • #18 g_main_loop_run
    at gmain.c line 4034
  • #19 meta_run
    at core/main.c line 521
  • #20 main
    at main.c line 471
  • #4 meta_window_unmanage
    at core/window.c line 1355
1350	      meta_topic (META_DEBUG_FOCUS,
1351	                  "Unmanaging window %s which doesn't currently have focus\n",
1352	                  window->desc);
1353	    }
1354	
1355	  g_assert (window->display->focus_window != window);
1356	
1357	  if (window->struts)
1358	    {
1359	      meta_free_gslist_and_elements (window->struts);
Comment 1 Rui Matos 2016-01-06 16:26:37 UTC
Created attachment 318344 [details] [review]
window: Re-evaluate window visibility when making it transient

In case a window is hidden when we're ordered to make it transient to
a different parent we must re-evaluate its visibility status or we'll
get into an inconsistent state where the parent is visible and the
child isn't.
--

When a main window of this reproducer gets minimized, its transients
are hidden as expected. But when it then makes the dialogs transients
to the other still visible window we don't show the transients. This
is, I argue, the root problem.

The assertion is then hit if the visible window is unmanaged because
when we ask the stack for the next window in the stack to be focused
it returns the hidden dialog but since it's hidden we refuse to focus
it and thus we hit the assertion. This obviously doesn't happen
anymore if the dialog is shown as soon as it's set transient as in
this patch.
Comment 2 Jasper St. Pierre (not reading bugmail) 2016-01-06 16:28:18 UTC
Review of attachment 318344 [details] [review]:

Makes sense.
Comment 3 Rui Matos 2016-01-06 18:01:48 UTC
Attachment 318344 [details] pushed as 3a2cd33 - window: Re-evaluate window visibility when making it transient