Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Gnome-shell crashes when we use "workspace-grid" extension ( affects gnome-shell=3.30.2 ) #106

Open
harish2704 opened this issue Nov 28, 2018 · 5 comments

Comments

@harish2704
Copy link

Since version 3.30.2 Gnome shell is crashing when we use use "workspace-grid" extension.

Details

  • Gnome-shell version: 3.30.2
  • workspace-grid version: 29
  • OS : OpenSUSE Tumbleweed

workspace grid configuration:

image

Stack trace

Core was generated by `/usr/bin/gnome-shell'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  meta_compositor_switch_workspace (compositor=0x0, from=0x55cb5adb9130, to=<optimized out>, direction=META_MOTION_DOWN)
    at compositor/compositor.c:832
832	  compositor->switch_workspace_in_progress++;
[Current thread is 1 (Thread 0x7f32527c5b00 (LWP 1853))]
(gdb) bt full
#0  0x00007f325b68f115 in meta_compositor_switch_workspace
    (compositor=0x0, from=0x55cb5adb9130, to=<optimized out>, direction=META_MOTION_DOWN) at compositor/compositor.c:832
        to_indx = 1
        from_indx = 0
#1  0x00007f325b6c7d13 in meta_workspace_activate_with_focus
    (workspace=0x55cb5adb91c0, focus_this=focus_this@entry=0x0, timestamp=timestamp@entry=26055067) at core/workspace.c:636
        old = 0x55cb5adb9130
        move_window = <optimized out>
        comp = 0x0
        layout1 = {rows = 18, cols = 1, grid = 0x55cb5b131130, grid_area = 18, current_row = 0, current_col = 0}
        layout2 = {rows = 18, cols = 1, grid = 0x55cb5b0f1e50, grid_area = 18, current_row = 1, current_col = 0}
        num_workspaces = <optimized out>
        current_space = <optimized out>
        new_space = <optimized out>
        direction = META_MOTION_DOWN
#2  0x00007f325b6c7f99 in meta_workspace_activate (workspace=<optimized out>, timestamp=timestamp@entry=26055067) at core/workspace.c:665
#3  0x00007f325b6d073c in meta_x11_display_new (display=display@entry=0x55cb5b0c6090, error=error@entry=0x7ffdcabd0eb8)
    at x11/meta-x11-display.c:1300
        x11_display = 0x55cb5abfc420
        xdisplay = 0x55cb5abc1b70
        xscreen = <optimized out>
        xroot = 278
        i = 123
        number = 0
        new_wm_sn_owner = <optimized out>
        replace_current_wm = 0
        wm_sn_atom = 562
        buf = "WM_S0", '\000' <repeats 122 times>
        timestamp = 26055067
        current_workspace = <optimized out>
        current_workspace_index = 1
        atom_restart_helper = 532
        restart_helper_window = <optimized out>
        gdk_display = <optimized out>
        backend = <optimized out>
        monitor_manager = <optimized out>
        atom_names = 
          {0x7f325b7442cc "WM_PROTOCOLS", 0x7f325b7442d9 "WM_TAKE_FOCUS", 0x7f325b7442e7 "WM_DELETE_WINDOW", 0x7f325b74455d "WM_STATE", 0x7f32--Type <RET> for more, q to quit, c to continue without paging--c
5b7442f8 "_MOTIF_WM_HINTS", 0x7f325b744308 "WM_CHANGE_STATE", 0x7f325b744318 "SM_CLIENT_ID", 0x7f325b744325 "WM_CLIENT_LEADER", 0x7f325b744336 "WM_WINDOW_ROLE", 0x7f325b744345 "UTF8_STRING", 0x7f325b744351 "WM_ICON_SIZE", 0x7f325b74435e "_KWM_WIN_ICON", 0x7f325b740aae "_MUTTER_HINTS", 0x7f325b74436c "_GTK_THEME_VARIANT", 0x7f325b745298 "_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED", 0x7f325b740b07 "_GTK_APPLICATION_ID", 0x7f325b740b2e "_GTK_UNIQUE_BUS_NAME", 0x7f325b740b57 "_GTK_APPLICATION_OBJECT_PATH", 0x7f325b740b90 "_GTK_WINDOW_OBJECT_PATH", 0x7f325b740bbf "_GTK_APP_MENU_OBJECT_PATH", 0x7f325b740bf2 "_GTK_MENUBAR_OBJECT_PATH", 0x7f325b74437f "_GTK_FRAME_EXTENTS", 0x7f325b744392 "_GTK_SHOW_WINDOW_MENU", 0x7f325b7443a8 "_GTK_EDGE_CONSTRAINTS", 0x7f325b7443be "_GNOME_WM_KEYBINDINGS", 0x7f325b7443d4 "_GNOME_PANEL_ACTION", 0x7f325b7443e8 "_GNOME_PANEL_ACTION_MAIN_MENU", 0x7f325b7452c0 "_GNOME_PANEL_ACTION_RUN_DIALOG", 0x7f325b744406 "_MUTTER_TIMESTAMP_PING", 0x7f325b74441d "_MUTTER_FOCUS_SET", 0x7f325b74442f "_MUTTER_SENTINEL", 0x7f325b744440 "_MUTTER_VERSION", 0x7f325b744450 "WM_CLIENT_MACHINE", 0x7f325b744462 "MANAGER", 0x7f325b74446a "TARGETS", 0x7f325b744472 "MULTIPLE", 0x7f325b74447b "TIMESTAMP", 0x7f325b744448 "VERSION", 0x7f325b744485 "ATOM_PAIR", 0x7f325b74448f "_XKB_RULES_NAMES", 0x7f325b7444a0 "WL_SURFACE_ID", 0x7f325b7444ae "_XWAYLAND_MAY_GRAB_KEYBOARD", 0x7f325b7444ca "_NET_WM_SYNC_REQUEST", 0x7f325b7444df "_NET_WM_SYNC_REQUEST_COUNTER", 0x7f325b7444fc "_NET_WM_VISIBLE_NAME", 0x7f325b744511 "_NET_SUPPORTING_WM_CHECK", 0x7f325b74452a "_NET_SUPPORTED", 0x7f325b744539 "_NET_WM_NAME", 0x7f325b744546 "_NET_CLOSE_WINDOW", 0x7f325b744558 "_NET_WM_STATE", 0x7f325b744566 "_NET_WM_STATE_SHADED", 0x7f325b74457b "_NET_WM_STATE_MAXIMIZED_HORZ", 0x7f325b744598 "_NET_WM_STATE_MAXIMIZED_VERT", 0x7f325b7445b5 "_NET_WM_DESKTOP", 0x7f325b7445c5 "_NET_NUMBER_OF_DESKTOPS", 0x7f325b7445dd "_NET_CURRENT_DESKTOP", 0x7f325b7445f2 "_NET_WM_WINDOW_TYPE", 0x7f325b744606 "_NET_WM_WINDOW_TYPE_DESKTOP", 0x7f325b744622 "_NET_WM_WINDOW_TYPE_DOCK", 0x7f325b74463b "_NET_WM_WINDOW_TYPE_TOOLBAR", 0x7f325b744657 "_NET_WM_WINDOW_TYPE_MENU", 0x7f325b744670 "_NET_WM_WINDOW_TYPE_UTILITY", 0x7f325b74468c "_NET_WM_WINDOW_TYPE_SPLASH", 0x7f325b7446a7 "_NET_WM_WINDOW_TYPE_DIALOG", 0x7f325b7452e0 "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", 0x7f325b745308 "_NET_WM_WINDOW_TYPE_POPUP_MENU", 0x7f325b7446c2 "_NET_WM_WINDOW_TYPE_TOOLTIP", 0x7f325b745328 "_NET_WM_WINDOW_TYPE_NOTIFICATION", 0x7f325b7446de "_NET_WM_WINDOW_TYPE_COMBO", 0x7f325b7446f8 "_NET_WM_WINDOW_TYPE_DND", 0x7f325b744710 "_NET_WM_WINDOW_TYPE_NORMAL", 0x7f325b74472b "_NET_WM_STATE_MODAL", 0x7f325b74473f "_NET_CLIENT_LIST", 0x7f325b744750 "_NET_CLIENT_LIST_STACKING", 0x7f325b74476a "_NET_WM_STATE_SKIP_TASKBAR", 0x7f325b744785 "_NET_WM_STATE_SKIP_PAGER", 0x7f325b74479e "_NET_WM_ICON", 0x7f325b7447ab "_NET_WM_ICON_GEOMETRY", 0x7f325b7447c1 "_NET_WM_MOVERESIZE", 0x7f325b7447d4 "_NET_ACTIVE_WINDOW", 0x7f325b7447e7 "_NET_WM_STRUT", 0x7f325b7447f5 "_NET_WM_STATE_HIDDEN", 0x7f325b74480a "_NET_WM_STATE_FULLSCREEN", 0x7f325b744823 "_NET_WM_PING", 0x7f325b744830 "_NET_WM_PID", 0x7f325b74483c "_NET_WORKAREA", 0x7f325b74484a "_NET_SHOWING_DESKTOP", 0x7f325b74485f "_NET_DESKTOP_LAYOUT", 0x7f325b744873 "_NET_DESKTOP_NAMES", 0x7f325b744886 "_NET_WM_ALLOWED_ACTIONS", 0x7f325b74489e "_NET_WM_ACTION_MOVE", 0x7f325b7448b2 "_NET_WM_ACTION_RESIZE", 0x7f325b7448c8 "_NET_WM_ACTION_SHADE", 0x7f325b7448dd "_NET_WM_ACTION_STICK", 0x7f325b7448f2 "_NET_WM_ACTION_MAXIMIZE_HORZ", 0x7f325b74490f "_NET_WM_ACTION_MAXIMIZE_VERT", 0x7f325b74492c "_NET_WM_ACTION_CHANGE_DESKTOP", 0x7f325b74494a "_NET_WM_ACTION_CLOSE", 0x7f325b74495f "_NET_WM_STATE_ABOVE", 0x7f325b744973 "_NET_WM_STATE_BELOW", 0x7f325b744987 "_NET_STARTUP_ID", 0x7f325b744997 "_NET_WM_STRUT_PARTIAL", 0x7f325b7449ad "_NET_WM_ACTION_FULLSCREEN", 0x7f325b7449c7 "_NET_WM_ACTION_MINIMIZE", 0x7f325b7449df "_NET_FRAME_EXTENTS", 0x7f325b7449f2 "_NET_REQUEST_FRAME_EXTENTS", 0x7f325b744a0d "_NET_WM_USER_TIME", 0x7f325b745350 "_NET_WM_STATE_DEMANDS_ATTENTION", 0x7f325b744a1f "_NET_MOVERESIZE_WINDOW", 0x7f325b744a36 "_NET_DESKTOP_GEOMETRY", 0x7f325b744a4c "_NET_DESKTOP_VIEWPORT", 0x7f325b744a62 "_NET_WM_USER_TIME_WINDOW", 0x7f325b744a7b "_NET_WM_ACTION_ABOVE", 0x7f325b744a90 "_NET_WM_ACTION_BELOW", 0x7f325b744aa5 "_NET_WM_STATE_STICKY", 0x7f325b744aba "_NET_WM_FULLSCREEN_MONITORS", 0x7f325b744ad6 "_NET_WM_STATE_FOCUSED", 0x7f325b744aec "_NET_WM_BYPASS_COMPOSITOR", 0x7f325b744b06 "_NET_WM_OPAQUE_REGION", 0x7f325b744b1c "_NET_WM_FRAME_DRAWN", 0x7f325b744b30 "_NET_WM_FRAME_TIMINGS", 0x7f325b744b46 "_NET_WM_WINDOW_OPACITY", 0x7f325b744b5d "_NET_RESTACK_WINDOW"}
        atoms = {318, 320, 319, 327, 347, 328, 331, 329, 330, 399, 38, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 510, 545, 546, 547, 548, 549, 550, 551, 552, 36, 325, 334, 335, 336, 553, 554, 314, 555, 556, 323, 324, 464, 394, 352, 357, 462, 362, 477, 366, 367, 466, 455, 458, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 368, 453, 454, 478, 479, 359, 469, 356, 397, 467, 480, 365, 321, 360, 354, 461, 460, 459, 472, 482, 483, 485, 486, 488, 487, 490, 491, 363, 364, 471, 468, 489, 484, 391, 557, 371, 370, 355, 456, 457, 372, 558, 559, 476, 473, 505, 496, 474, 560, 561, 361, 463}
        __func__ = "meta_x11_display_new"
#4  0x00007f325b6a689d in meta_display_open () at core/display.c:746
        error = 0x0
        display = 0x55cb5b0c6090
        x11_display = <optimized out>
        i = <optimized out>
        timestamp = <optimized out>
        old_active_xwindow = 0
        backend = 0x55cb5a90c130
        monitor_manager = <optimized out>
        settings = <optimized out>
        __func__ = "meta_display_open"
#5  0x00007f325b6b1bbc in meta_run () at core/main.c:686
#6  0x000055cb59a00782 in main (argc=<optimized out>, argv=<optimized out>) at ../src/main.c:501
        ctx = <optimized out>
        error = 0x0
        ecode = <optimized out>

How to reproduce this issue

  • Enable workspace-grid extension
  • place any two windows in two different workspaces ( for eg: for a 3x3 grid, I placed in top-centre and left-middle workspaces )
  • Restart gnome shell by pressing r

Now Gnome-shell will crash

@harish2704
Copy link
Author

I have reported this issue in gnome-shell's bug tracker too
https://gitlab.gnome.org/GNOME/gnome-shell/issues/823

@harish2704
Copy link
Author

I did some debugging and I can confirm that, it is not a mutter bug.

Actual problem lies on this function call

  /* Get current workspace */
  if (meta_prop_get_cardinal (x11_display,
                              x11_display->xroot,
                              x11_display->atom__NET_CURRENT_DESKTOP,
                              &current_workspace_index))

@ https://gitlab.gnome.org/GNOME/mutter/blob/master/src/x11/meta-x11-display.c#L1308

which returns wrong value.

Due to that wrong value, the condition @ https://gitlab.gnome.org/GNOME/mutter/blob/master/src/core/workspace.c#L537

  if (workspace->manager->active_workspace == workspace)
    return;

evaluates false and the return statement is not evaluated.

This is the root cause of this bug.

failure to compute current_workspace_index can be due to wrong calculation done by workspace-grid extension or due to some API change in mutter.

@harish2704
Copy link
Author

In 3x3 workspace grid, This bug happens only when I restart the shell from workspace other than workspace_no 1

It means, current_workspace_index is computed correctly if we are in first workspace and it fails when we are in other workspace.

it seems like a computation problem in grid layout

@stalet
Copy link

stalet commented Dec 17, 2018

It also happens sometimes after unlocking a gnome session.

@mikehardy
Copy link

I was crashing with the latest updates that came down on Ubuntu 18.04.01 LTS (it was still gnome-shell 3.28.x) using workplace-grid from the gnome extensions site, but only when I was running Android emulators. If you switched away from a workspace with an emulator visible, it would crash with very similar results to those posted (though I was sadly unable to get apport-retrace to do anything useful for me...).

It seems to be working fine with Ubuntu 18.10 + gnome-shell 3.30.1 though. Have you tried reverting? I'm just curious because I did a full OS upgrade (18.04 -> 18.10) to access gnome-shell 3.30.x which is currently working for me. But if 3.30.2 is going to make me crashy again I'll know to wait...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants