GNOME Bugzilla – Bug 642699
Segfault when closing some applications
Last modified: 2011-02-22 15:35:20 UTC
While trying to reproduce bug 642684 I have installed qt4 designer and noticed that after closing it and going to the overview the shell crashes. # (gdb) bt #
+ Trace 226022
It seems like the call to this.app.disconnect() in dash.js triggers that: # (gdb) call gjs_dumpstack() # == Stack trace for context 0x8b39e0 == # 0 anonymous([0x8a3a9c0 StButton.app-well-app]) ["/home/linux/gnome-shell/source/gnome-shell/js/ui/appDisplay.js":376] # 1 anonymous([0x8a3a9c0 StButton.app-well-app]) ["/home/linux/gnome-shell/install/share/gjs-1.0/lang.js":110] # 2 [native frame] # 3 anonymous() ["/home/linux/gnome-shell/source/gnome-shell/js/ui/dash.js":127] # 4 anonymous() ["/home/linux/gnome-shell/install/share/gjs-1.0/lang.js":110] # 5 anonymous() ["/home/linux/gnome-shell/source/gnome-shell/js/ui/tweener.js":101] # 6 _callOnFunction(params = undefined, fallbackScope = [object Object], scope = undefined, fnname = "onComplete", fn = [function]) ["/home/linux/gnome-shell/install/share/gjs-1.0/tweener/tweener.js":202] # 7 _updateTweenByIndex(i = 14) ["/home/linux/gnome-shell/install/share/gjs-1.0/tweener/tweener.js":332] # 8 _updateTweens() ["/home/linux/gnome-shell/install/share/gjs-1.0/tweener/tweener.js":344] # 9 _onEnterFrame([object Object]) ["/home/linux/gnome-shell/install/share/gjs-1.0/tweener/tweener.js":359] # 10 _emit(name = "prepare-frame") ["/home/linux/gnome-shell/install/share/gjs-1.0/signals.js":124] # 11 anonymous(frame = 203) ["/home/linux/gnome-shell/source/gnome-shell/js/ui/tweener.js":237] # 12 anonymous(frame = 203, timeline = [object instance proxy GIName:Clutter.Timeline jsobj@0x10eaf00 native@0xf8d460]) ["/home/linux/gnome-shell/source/gnome-shell/js/ui/tweener.js":213] # 13 anonymous([object instance proxy GIName:Clutter.Timeline jsobj@0x10eaf00 native@0xf8d460], 203) ["/home/linux/gnome-shell/install/share/gjs-1.0/lang.js":110] I am not exactly sure what is going on here (and neither why it is 100% reproduce able with one specific app and not with others).
Looking at source code, I think that get_app_from_window_pid in src/shell-window-tracker.c should return a new reference to the ShellApp it returns, since all other functions do (get_app_from_window_group, get_app_from_window_wmclass), so get_app_from_window is probably (transfer full). Will soon prepare the easy patch, so you can check if the bug persists.
Created attachment 181322 [details] [review] ShellWindowTracker: fix a reference counting bug When retrieving a ShellApp from the GHashTable of child processes, we need to take an extra reference, that the GHashTable of windows to apps will own. Also add some documentation to avoid repeating this bug in the future.
(In reply to comment #2) > Created an attachment (id=181322) [details] [review] > ShellWindowTracker: fix a reference counting bug > > When retrieving a ShellApp from the GHashTable of child processes, > we need to take an extra reference, that the GHashTable of windows > to apps will own. > Also add some documentation to avoid repeating this bug in the future. This seems to fix it, thanks!
Review of attachment 181322 [details] [review]: This looks good to me! Thanks for finding it.
Attachment 181322 [details] pushed as 5683bb9 - ShellWindowTracker: fix a reference counting bug