! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Fix crash when application is killed
Status:
RESOLVED: FIXED
Product:
Xfce4-taskmanager
Component:
General

Comments

Description Olivier Duchateau 2017-02-20 23:38:38 CET
Created attachment 7012 
Fix crash when application is killed

I noticed when xfce4-taskmanager is build against Gtk3, it crashes when I kill an application (with Gtk2 no problem).

Patch fixes this issue.
Comment 1 Landry Breuil editbugs 2017-02-23 09:47:53 CET
I see a very similar crash upon exiting taskmanager, to me there's a problem with the treeview referencing somewhere. With debug symbols, there's a SIGBUS on https://git.xfce.org/apps/xfce4-taskmanager/tree/src/process-window.c#n341 when exiting. What was the trace for the crash you were seeing ?

As for your crash (ie when killing an app) - it seems your patch fixes it. But i think it's also somewhat related to the crash i see upon exit.

For me there's a double-free - and also only when using Gtk3.
Comment 2 Landry Breuil editbugs 2017-02-25 10:51:51 CET
Here, git master built with gtk3, if i try to kill a process via right-click menu, taskman doesnt crash, the process is killed, i only have a warning on stdout:

(xfce4-taskmanager:97071): Gtk-CRITICAL **: gtk_tree_view_get_selection: assertion 'GTK_IS_TREE_VIEW (tree_view)' failed

(xfce4-taskmanager:97071): Gtk-CRITICAL **: gtk_tree_selection_unselect_all: assertion 'GTK_IS_TREE_SELECTION (selection)' failed
Comment 3 Olivier Duchateau 2017-02-25 12:02:11 CET
(In reply to Landry Breuil from comment #2)
> Here, git master built with gtk3, if i try to kill a process via right-click
> menu, taskman doesnt crash, the process is killed, i only have a warning on
> stdout:
> 
> (xfce4-taskmanager:97071): Gtk-CRITICAL **: gtk_tree_view_get_selection:
> assertion 'GTK_IS_TREE_VIEW (tree_view)' failed
> 
> (xfce4-taskmanager:97071): Gtk-CRITICAL **: gtk_tree_selection_unselect_all:
> assertion 'GTK_IS_TREE_SELECTION (selection)' failed

About warning I also noticed it. But I wonder how xfce4-taskmanager (git branch) does not crash anymore. 1.2.0 and git branch are very closed (I use 2 patches which were pushed).
Comment 4 Skunnyk editbugs 2017-07-04 22:38:45 CEST
By default, taskmanager still use gtk2. You need to pass --enable-gtk3 to the configure script, and the crash does not happen with gtk3.
Comment 5 Olivier Duchateau 2017-07-05 16:00:44 CEST
(In reply to Skunnyk from comment #4)
> By default, taskmanager still use gtk2. You need to pass --enable-gtk3 to
> the configure script, and the crash does not happen with gtk3.

Did you read completely bug report? Crash occurs when xfce4-taskmanager is compiled with Gtk3 (that's why on FreeBSD it is still with Gtk2). For me, the problem still persists with the 1.2.0 release (not tested with git snapshot, and I don't want, FreeBSD end users use stable releases no snapshot).
Comment 6 Skunnyk editbugs 2017-07-05 17:05:48 CEST
Ok, got confused with https://bugzilla.xfce.org/show_bug.cgi?id=12132 .

I can't reproduce with 1.2.0 or git master with gtk3 on a linux system btw.
Comment 7 Landry Breuil editbugs 2018-05-27 11:59:04 CEST
Can't reproduce right now either with current git master, built against gtk3 on OpenBSD
Comment 8 Ivan 83 2018-05-27 17:30:22 CEST
Because this patch commited.
Original it was my patch on FreeBSD bug tacker.

I use GTK2, probably a bit outdated.
Crash was on:
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));

because treeview = NULL.
So I add missed set:
g_object_set_data (G_OBJECT (mi), "treeview", treeview);

And add check that it really set:
		if (treeview == NULL)
			return;

Probably GTK3 already have check for NULL some where in gtk_tree_view_get_selection().
Comment 9 Landry Breuil editbugs 2018-06-07 08:03:06 CEST
I'm not 100% sure the issue is fully fixed, with git master built against gtk3 i had another crash on treeview being null in the _finalize function upon exit, but i havent been able to reliably reproduce it. Anyway, that's a different issue from the one being discussed it :)

Bug #13370

Reported by:
Olivier Duchateau
Reported on: 2017-02-20
Last modified on: 2018-06-07

People

Assignee:
Mike Massonnet
CC List:
5 users

Version

Attachments

Fix crash when application is killed (1.19 KB, patch)
2017-02-20 23:38 CET , Olivier Duchateau
no flags

Additional information