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 721439 - Reproducible crash moving windows in the overview
Reproducible crash moving windows in the overview
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2014-01-03 23:40 UTC by Giovanni Campagna
Modified: 2014-01-04 16:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ShellWindowTracker: fix reference counting of ShellApp (1.57 KB, patch)
2014-01-04 15:52 UTC, Giovanni Campagna
committed Details | Review
ShellWindowTracker: remove gtk-doc marks from private functions (1.40 KB, patch)
2014-01-04 16:34 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2014-01-03 23:40:54 UTC
How to reproduce:
1) Start on a workspace with at least 3 windows
2) Enter the overview
3) Move two windows, from the workspace thumbnail, in between two workspaces, to create two new workspaces
4) The moment you drop the second window, gnome-shell crashes

Backtrace:
  • #0 _shell_app_add_window
    at shell-app.c line 1011
  • #1 track_window
    at shell-window-tracker.c line 501
  • #2 g_closure_invoke
    at gclosure.c line 777
  • #3 signal_emit_unlocked_R
    at gsignal.c line 3556
  • #4 g_signal_emit_valist
    at gsignal.c line 3312
  • #5 g_signal_emit
    at gsignal.c line 3368
  • #6 meta_workspace_add_window
    at core/workspace.c line 362
  • #7 meta_window_change_workspace_without_transients
    at core/window.c line 6128
  • #8 meta_window_change_workspace
    at core/window.c line 6151
  • #9 ffi_call_unix64
    at ../src/x86/unix64.S line 76
  • #10 ffi_call
    at ../src/x86/ffi64.c line 522
  • #11 gjs_invoke_c_function
    at gi/function.cpp line 924
  • #12 function_call
    at gi/function.cpp line 1233
  • #13 CallJSNative
    at ./jscntxtinlines.h line 321
  • #14 js::Invoke
    at /home/giovanni/gnome/js24-24.2.0/js/src/vm/Interpreter.cpp line 474
  • #15 js::Invoke
    at /home/giovanni/gnome/js24-24.2.0/js/src/vm/Interpreter.cpp line 531
  • #16 js::jit::DoCallFallback
    at /home/giovanni/gnome/js24-24.2.0/js/src/jit/BaselineIC.cpp line 7007
  • #17 ??
  • #18 ??

Comment 1 Giovanni Campagna 2014-01-03 23:44:21 UTC
Correction on the reproducer.

This is not about the number of windows, or workspaces getting collected, as I suspected.
Instead, it's about memory management of ShellApp being wrong for locally created GDesktopAppInfos.
Reliable reproducer:
1) Have an app created from a .local/share/applications file running
2) Move a window from that app to create a new workspace
3) Move any other window to another workspace
4) Crash
Comment 2 Jasper St. Pierre (not reading bugmail) 2014-01-04 04:52:05 UTC
Segfaulting at shell-app.c:1011? There's nothing related to GDesktopAppInfo on that line. Is it segfaulting accessing running_state?
Comment 3 Giovanni Campagna 2014-01-04 12:50:21 UTC
(In reply to comment #2)
> Segfaulting at shell-app.c:1011? There's nothing related to GDesktopAppInfo on
> that line. Is it segfaulting accessing running_state?

Indeed I said memory management of ShellApp, not GDesktopAppInfo. The app pointer points to a freed GObject in that function.
Comment 4 Giovanni Campagna 2014-01-04 15:52:27 UTC
Created attachment 265306 [details] [review]
ShellWindowTracker: fix reference counting of ShellApp

All get_app_from_*() helpers are transfer full, but
get_app_from_gapplication_id() was directly returning the result
of lookup_app(), which is transfer none.

And here it is. Except the culprit was bloatpad and not GMail. Oh well :)
Comment 5 Jasper St. Pierre (not reading bugmail) 2014-01-04 16:05:19 UTC
Review of attachment 265306 [details] [review]:

Aha, yep. I'm not sure how this worked before.

::: src/shell-window-tracker.c
@@ +257,3 @@
 }
 
+/**

Remove the second *, otherwise gobject-introspection will complain about a mismatched annotation (and emacs will think it's a public function).
Comment 6 Giovanni Campagna 2014-01-04 16:34:17 UTC
Created attachment 265312 [details] [review]
ShellWindowTracker: remove gtk-doc marks from private functions

static internal functions should be documented with /*, not /**
Comment 7 Giovanni Campagna 2014-01-04 16:34:44 UTC
Attachment 265306 [details] pushed as 6544326 - ShellWindowTracker: fix reference counting of ShellApp
Attachment 265312 [details] pushed as 65f00f3 - ShellWindowTracker: remove gtk-doc marks from private functions