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 737581 - Crash with switching workspace on dual screen configuration
Crash with switching workspace on dual screen configuration
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2014-09-29 12:14 UTC by Lionel Landwerlin
Modified: 2014-09-30 10:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
workspace: Correctly initialize MRU list (1.60 KB, patch)
2014-09-29 21:27 UTC, Florian Müllner
reviewed Details | Review
display: Optionally sort window list (1.66 KB, patch)
2014-09-29 22:02 UTC, Florian Müllner
committed Details | Review
workspace: Correctly initialize MRU list (1.63 KB, patch)
2014-09-29 22:02 UTC, Florian Müllner
committed Details | Review

Description Lionel Landwerlin 2014-09-29 12:14:28 UTC
I get fairly regular crash when switching workspaces on my dual screen workstation.
Not sure what actually triggers the crashes...

Here is the backtrace from the C side :


Thread 1 (Thread 0x7fbcbd68fac0 (LWP 6474))

  • #0 __GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 56
  • #1 __GI_abort
    at abort.c line 89
  • #2 g_assertion_message
  • #3 g_assertion_message_expr
    at /build/glib2.0-Dv_k6u/glib2.0-2.42.0/./glib/gtestutils.c line 2306
  • #4 meta_window_set_focused_internal
    at core/window.c line 4725
  • #5 meta_display_update_focus_window
    at core/display.c line 1453
  • #6 request_xserver_input_focus_change
    at core/display.c line 1532
  • #7 meta_window_x11_focus
    at x11/window-x11.c line 776
  • #8 meta_window_focus
    at core/window.c line 4279
  • #9 focus_ancestor_or_top_window
    at core/workspace.c line 1275
  • #10 meta_workspace_focus_default_window
    at core/workspace.c line 1167
  • #11 meta_workspace_activate_with_focus
    at core/workspace.c line 598
  • #12 ffi_call_unix64
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #13 ffi_call
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #14 ??
    from /usr/lib/libgjs.so.0
  • #15 ??
    from /usr/lib/libgjs.so.0
  • #16 ??
    from /usr/lib/x86_64-linux-gnu/libmozjs-24.so.0
  • #17 ??
    from /usr/lib/x86_64-linux-gnu/libmozjs-24.so.0
  • #18 ??
    from /usr/lib/x86_64-linux-gnu/libmozjs-24.so.0
  • #19 ??
    from /usr/lib/x86_64-linux-gnu/libmozjs-24.so.0
  • #20 ??
    from /usr/lib/x86_64-linux-gnu/libmozjs-24.so.0
  • #21 ??
    from /usr/lib/x86_64-linux-gnu/libmozjs-24.so.0
  • #22 ??
    from /usr/lib/x86_64-linux-gnu/libmozjs-24.so.0
  • #23 ??
    from /usr/lib/x86_64-linux-gnu/libmozjs-24.so.0
  • #24 ??
  • #25 ??
  • #26 ??
  • #27 ??
A debugging session is active.



Here is the backtrace from the JS side :

 == Stack trace for context 0x38301c0 ==
 WorkspaceThumbnail<.activate@resource:///org/gnome/shell/ui/workspaceThumbnail.js:551
 wrapper@resource:///org/gnome/gjs/modules/lang.js:169
 ThumbnailsBox<._onButtonRelease@resource:///org/gnome/shell/ui/workspaceThumbnail.js:683
 wrapper@resource:///org/gnome/gjs/modules/lang.js:169
 == Stack trace for context 0x38301c0 ==
 WorkspaceThumbnail<.activate@resource:///org/gnome/shell/ui/workspaceThumbnail.js:551
 wrapper@resource:///org/gnome/gjs/modules/lang.js:169
 ThumbnailsBox<._onButtonRelease@resource:///org/gnome/shell/ui/workspaceThumbnail.js:683
 wrapper@resource:///org/gnome/gjs/modules/lang.js:169
 == Stack trace for context 0x38301c0 ==
 WorkspaceThumbnail<.activate@resource:///org/gnome/shell/ui/workspaceThumbnail.js:551
 wrapper@resource:///org/gnome/gjs/modules/lang.js:169
 ThumbnailsBox<._onButtonRelease@resource:///org/gnome/shell/ui/workspaceThumbnail.js:683
 wrapper@resource:///org/gnome/gjs/modules/lang.js:169
 /usr/lib/libgjs.so.0(gjs_print_backtrace+0x31)[0x7fbcbc9ca841]
 [0x7fff624255bf]
Comment 1 Lionel Landwerlin 2014-09-29 12:15:35 UTC
Seems to be related to #737577
Comment 2 Jasper St. Pierre (not reading bugmail) 2014-09-29 13:56:09 UTC
Can you try git master after Florian's workspace fixes?
Comment 3 Owen Taylor 2014-09-29 14:11:49 UTC
*** Bug 737577 has been marked as a duplicate of this bug. ***
Comment 4 Lionel Landwerlin 2014-09-29 14:56:22 UTC
Recompiled master with all patches from  https://git.gnome.org/browse/mutter/commit/?id=2eec11b4453ecefd963385b810ea8daf330b7d22 and it still crashes.

I'm getting better at getting it to crash now, here are the steps :

1. Close all windows
2. Open a window on the main screen on first workspace 
3. Open a window on the second screen
4. Open overview and click on last workspace (the second one, it should be empty)
5. Open a new window on the main screen
6. Open overview and click on the last workspace (the third one, it should be empty) => assert/crash
Comment 5 Jasper St. Pierre (not reading bugmail) 2014-09-29 15:27:46 UTC
OK. I don't have a second screen to test with right now. Florian, can you take a look at this one? I can't think of any reason this would happen -- the window should be in the MRU list for all workspaces if it's sticky.
Comment 6 Sebastián Lara Menares 2014-09-29 20:10:55 UTC
Hi, I can reproduce this bug in Debian Sid with GNOME 3.14.0

Log from journalctl:

Sep 29 16:54:01 arrayan gnome-session[1424]: **
Sep 29 16:54:01 arrayan gnome-session[1424]: mutter:ERROR:core/window.c:4725:meta_window_set_focused_internal: assertion failed: (link)
Sep 29 16:54:01 arrayan gnome-session[1424]: gnome-session[1424]: WARNING: Application 'gnome-shell.desktop' killed by signal 6
Comment 7 Florian Müllner 2014-09-29 21:27:27 UTC
Created attachment 287400 [details] [review]
workspace: Correctly initialize MRU list

The workspace MRU lists are updated when windows are managed/unmanaged
or change workspaces. However those updates obviously only apply to
existing workspaces - new workspaces will always start out with an empty
MRU list, despite sticky windows already being "on" that workspace.
As we now assert that the list contains all windows located on the
workspace, we need to initialize it correctly to avoid a crash.
Comment 8 Florian Müllner 2014-09-29 21:33:40 UTC
(In reply to comment #5)
> OK. I don't have a second screen to test with right now.

Here's a reproducer which does not require a second screen:

 (1) make a window sticky
 (2) trigger creation of a new workspace
 (3) switch to the new workspace
Comment 9 Jasper St. Pierre (not reading bugmail) 2014-09-29 21:38:29 UTC
Review of attachment 287400 [details] [review]:

::: src/core/workspace.c
@@ +182,3 @@
 
+  /* make sure sticky windows are in our mru_list */
+  windows = meta_display_list_windows (screen->display, META_LIST_DEFAULT);

You leak this.

I'm also not sure it's sorted correctly (it's just a ptrcmp), but I'm not sure what the correct initial sort should be.
Comment 10 Florian Müllner 2014-09-29 22:02:45 UTC
Created attachment 287401 [details] [review]
display: Optionally sort window list
Comment 11 Florian Müllner 2014-09-29 22:02:56 UTC
Created attachment 287402 [details] [review]
workspace: Correctly initialize MRU list

The workspace MRU lists are updated when windows are managed/unmanaged
or change workspaces. However those updates obviously only apply to
existing workspaces - new workspaces will always start out with an empty
MRU list, despite sticky windows already being "on" that workspace.
As we now assert that the list contains all windows located on the
workspace, we need to initialize it correctly to avoid a crash.
Comment 12 Jasper St. Pierre (not reading bugmail) 2014-09-29 22:05:37 UTC
Review of attachment 287401 [details] [review]:

Clever. I like it.
Comment 13 Jasper St. Pierre (not reading bugmail) 2014-09-29 22:05:48 UTC
Review of attachment 287402 [details] [review]:

OK.
Comment 14 Florian Müllner 2014-09-29 22:24:50 UTC
Attachment 287401 [details] pushed as 9f8b641 - display: Optionally sort window list
Attachment 287402 [details] pushed as 4f3de2c - workspace: Correctly initialize MRU list
Comment 15 Cédric Bellegarde 2014-09-30 07:20:59 UTC
Compil with 2 previous patch doesn't fix the issue:

sept. 30 09:14:45 arch gnome-session[424]: mutter:ERROR:core/window.c:4725:meta_window_set_focused_internal: assertion failed: (link)
sept. 30 09:14:46 arch gnome-session[424]: gnome-session[424]: WARNING: Application 'gnome-shell.desktop' killed by signal 6
sept. 30 09:14:46 arch gnome-session[424]: WARNING: Application 'gnome-shell.desktop' killed by signal 6

It happens when closing a tab in firefox (maximised on second screen)
Maybe another bug?
https://bugzilla.gnome.org/show_bug.cgi?id=737577
Comment 16 Lionel Landwerlin 2014-09-30 10:02:14 UTC
Recompiled with the all the patches from master seems to fix my problem here.
Thanks a lot.