Crash unmanaging windows on secondary monitor when “workspaces-only-on-primary”
This is a follow-up on bug 792818 where mutter would crash in x11/session code while saving the state of windows on secondary monitor when “workspaces-only-on-primary”
Now it aborts a bit further in meta_window_unmanage() because the window being unmanaged is not removed from the workspace->windows list:
(gdb) bt
#0 0x00007fc4c609d54b in raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
#1 0x0000000000402adc in dump_gjs_stack_on_signal_handler (signo=6) at main.c:373
#2 0x00007fc4c609d680 in <signal handler called> () at /usr/lib64/libpthread-2.17.so
#3 0x00007fc4c5cf71b7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#4 0x00007fc4c5cf88a8 in __GI_abort () at abort.c:90
#5 0x00007fc4c6520aa5 in g_assertion_message (domain=domain@entry=0x7fc4cc55d2b3 "mutter", file=file@entry=0x7fc4cc567762 "core/window.c", line=line@entry=1520, func=func@entry=0x7fc4cc569970 <__FUNCTION__.106598> "meta_window_unmanage", message=message@entry=0xe624c0 "assertion failed: (g_list_find (workspace->windows, window) == NULL)") at gtestutils.c:2436
#6 0x00007fc4c6520b3a in g_assertion_message_expr (domain=domain@entry=0x7fc4cc55d2b3 "mutter", file=file@entry=0x7fc4cc567762 "core/window.c", line=line@entry=1520, func=func@entry=0x7fc4cc569970 <__FUNCTION__.106598> "meta_window_unmanage", expr=expr@entry=0x7fc4cc568940 "g_list_find (workspace->windows, window) == NULL") at gtestutils.c:2459
#7 0x00007fc4cc50b0cb in meta_window_unmanage (window=window@entry=0x2511240 [MetaWindowX11], timestamp=timestamp@entry=0)
at core/window.c:1520
#8 0x00007fc4cc4eb950 in meta_display_unmanage_windows_for_screen (display=<optimized out>, screen=<optimized out>, timestamp=0)
at core/display.c:2688
#9 0x00007fc4cc4fb70f in meta_screen_free (screen=0xc626c0 [MetaScreen], timestamp=0) at core/screen.c:845
#10 0x00007fc4cc4ebe5e in meta_display_close (display=0xe416e0 [MetaDisplay], timestamp=timestamp@entry=0) at core/display.c:1133
#11 0x00007fc4cc4f6f60 in meta_run () at core/main.c:297
#12 0x00007fc4cc4f6f60 in meta_run () at core/main.c:654
#13 0x0000000000402584 in main (argc=1, argv=0x7ffd73420118) at main.c:539
(gdb) f 7
#7 0x00007fc4cc50b0cb in meta_window_unmanage (window=window@entry=0x2511240 [MetaWindowX11], timestamp=timestamp@entry=0)
at core/window.c:1520
1520 g_assert (g_list_find (workspace->windows, window) == NULL);
(gdb) list
1515 tmp = window->screen->workspaces;
1516 while (tmp != NULL)
1517 {
1518 MetaWorkspace *workspace = tmp->data;
1519
1520 g_assert (g_list_find (workspace->windows, window) == NULL);
1521 g_assert (g_list_find (workspace->mru_list, window) == NULL);
1522
1523 tmp = tmp->next;
1524 }
(gdb) p window->workspace
$7 = 0x0
(gdb) p window->on_all_workspaces
$8 = 0
So I suspect when unmanaging the window, calling set_workspace_state (window, FALSE, NULL); we leave set_workspace_state() before actually removing the window from all workspaces because of this:
4682
4683 if (on_all_workspaces == window->on_all_workspaces &&
4684 workspace == window->workspace &&
4685 !window->constructing)
4686 return;
Edited by Olivier Fourdan