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 738384 - crash when creating a new workspace with sticky windows that have struts
crash when creating a new workspace with sticky windows that have struts
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-10-12 10:47 UTC by Tom Beckmann
Modified: 2014-10-13 11:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch fixing the issue (1.76 KB, patch)
2014-10-12 10:47 UTC, Tom Beckmann
reviewed Details | Review
corrected patch (1.75 KB, patch)
2014-10-12 11:05 UTC, Tom Beckmann
committed Details | Review

Description Tom Beckmann 2014-10-12 10:47:31 UTC
Created attachment 288304 [details] [review]
patch fixing the issue

The constructor of MetaWorkspace currently collects windows that are sticky before initializing its state which leads to a crash in the case of windows with struts which trigger a work area recalculation where mutter assumes, due to uninitialized state, that an existing work area has to be freed. This leads to a crash since the invalid_work_areas has not been set to TRUE yet when meta_workspace_invalidate_work_area is reached. (Backtrace if you want additional infos http://pastebin.com/BJ7F97jN)

Patch that fixes it is attached.
Comment 1 Florian Müllner 2014-10-12 10:57:33 UTC
Review of attachment 288304 [details] [review]:

::: src/core/workspace.c
@@ +202,3 @@
+  windows = meta_display_list_windows (screen->display, META_LIST_SORTED);
+  for (l = windows; l; l = l->next)
+    if (meta_window_located_on_workspace (l->data, workspace)) {

Wrong coding style: either leave out the braces, or use
  if ()
    {
      add_window();
    }
Comment 2 Tom Beckmann 2014-10-12 11:05:05 UTC
Created attachment 288305 [details] [review]
corrected patch

Sorry, I had that changed to add a debug print.
Comment 3 Florian Müllner 2014-10-12 11:09:27 UTC
Review of attachment 288305 [details] [review]:

No problem, thanks for the patch!
Comment 4 Rico Tzschichholz 2014-10-12 20:31:53 UTC
Review of attachment 288305 [details] [review]:

commit d07e2f409089ac08e6f7f0eeae978ee681c80354
Author: Tom Beckmann <tomjonabc@gmail.com>
Date:   Sun Oct 12 11:18:58 2014 +0200

    workspace: fix crash when creating a new workspace with sticky windows that have struts
    
    The constructor would collect windows that are sticky before initializing its state
    which would lead to a crash in the case of windows with struts which trigger a work
    area recalculation where mutter would assume, due to uninitialized state, that an
    existing work area has to be freed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738384