GNOME Bugzilla – Bug 509866
"Close tab" button doesn't kill shell.
Last modified: 2014-01-20 23:12:42 UTC
Please describe the problem: "Close tab" button doesn't kill shell. Then closing tab with exit command, shell is killed. Steps to reproduce: 1. launch gnome-terminal 2. $who (in gnome-terminal) user tty7 2008-01-16 07:53 (:0) user pts/0 2008-01-16 07:54 (:0.0) 3. ctrl + alt + t (new tab) $ who user tty7 2008-01-16 07:53 (:0) user pts/0 2008-01-16 07:54 (:0.0) user pts/1 2008-01-16 19:55 (:0.0 3. click "Close tab" button $ who user tty7 2008-01-16 07:53 (:0) user pts/0 2008-01-16 07:54 (:0.0) user pts/1 2008-01-16 19:55 (:0.0 Actual results: Expected results: Does this happen every time? yes, always. Other information: OS : Fedora development (rawhide 20080116) gnome-terminal-2.21.5-1.fc9 vte-0.16.12-1.fc9
There are more affected people under gentoo: http://bugs.gentoo.org/show_bug.cgi?id=219964 Thanks for fixing this
*** Bug 515742 has been marked as a duplicate of this bug. ***
Looks like vte bug 488960.
The patch from #488960 has no effect on this bug... tested on gentoo with VTE 0.16.14 and GT 2.22.3. Is the patch presented there is Solaris specific? After a week or 2 uptime I can have a dozen or so spare bash processes cluttering up my process list.
Created attachment 115666 [details] [review] Patch to fix killing of shell when tab is closed Okay, I'm a n00b to the code, but from what I could see, it appears that terminal_window_add_screen() takes a gobject reference on the screen that is not released at terminal_window_remove_screen() time. I dumped a few debug messages in the corresponding unrealize(), dispose() and finalize() methods. With the current (2.22.3) code, only unrealize() is called when a tab is closed. With the attached patch, all three get called.
The refcount leak is already fixed on svn trunk / 2.23.x. Is this bug reproducible there? There won't be another 2.22.x release, so no need for this patch although it is correct.
(In reply to comment #6) > The refcount leak is already fixed on svn trunk / 2.23.x. Is this bug > reproducible there? > There won't be another 2.22.x release, so no need for this patch although it is > correct. I currently cannot access development tree, but I am given to understand from others that this is fixed in these. Thanks for the review. Since there isn't going to be another 2.22.x release, we'll probably need to ship this patch.
Created attachment 115676 [details] [review] Patch to fix killing of shell when tab is closed (including with the button) So the previous patch only fixed the bug when closing with ctr-shift-w. This patch should fix this when the close button is used. Please comment. TIA.
The best fix would be to simply remove the extra g_object_ref that's adding this ref. -- This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
This bug is still in version 2.24... I tested the patch (id=115676) from Arun Raghavan in 2.24.0-0ubuntu1, but I've some errors with compile. Can you fix this?
I tested programs on gnome-terminal. As yet only tvtime is no killing when tab is close. Reproduce: 1. Open gnome-terminal 2. Put tvtime and run it 3. Close gnome-terminal 4. tvtime isn't killed, sound from tv is still
This bug isn't about *other* processes started from the shell not being killed when the tab is closed; it is *only* about the shell process itself not being killed. Please confirm that the shell itself is still running after the tab was closed; otherwise this bug goes back to FIXED.
At least mine was - the shell *and* processes stayed (as shell ignored KILL waiting for HUP). So if it'll go back to FIXED the bug 515742 should be reopened.
Works with 2.26.0, can be set to fixed, i think.
Nope, this isn't fixed with tvtime - see comment #11.
Ari: please see comment 12.
Testing with 2.26: andreas@andreas-desktop:~$ who andreas tty7 2009-03-23 16:23 (:0) andreas pts/1 2009-03-23 22:58 (:0.0) andreas@andreas-desktop:~$ Now opening 3 tabs: andreas@andreas-desktop:~$ who andreas tty7 2009-03-23 16:23 (:0) andreas pts/0 2009-03-23 22:59 (:0.0) andreas pts/2 2009-03-23 22:59 (:0.0) andreas pts/3 2009-03-23 22:59 (:0.0) andreas pts/1 2009-03-23 22:58 (:0.0) andreas@andreas-desktop:~$ Closing the 3 opened tabs: andreas@andreas-desktop:~$ who andreas tty7 2009-03-23 16:23 (:0) andreas pts/1 2009-03-23 22:58 (:0.0) andreas@andreas-desktop:~$ Closing confirmed by ps: andreas@andreas-desktop:~$ ps aux | grep bash andreas 28102 0.1 0.3 6380 3640 pts/1 Rs 22:58 0:00 bash andreas 28375 0.0 0.0 3336 804 pts/1 S+ 23:00 0:00 grep bash andreas@andreas-desktop:~$ So, yes, the issue described HERE is fixed.
@Christian Persch So do I need to open new bug? In tvtime or gnome-terminal?
*** Bug 570788 has been marked as a duplicate of this bug. ***
Closing as it's fixed. Artur, if you still have your tvtime issue, please try checking if this also happens with another terminal emulator (xterm or Konsole for instance). If it does, file a bug for tvtime, if it doesn't you can file a gnome-terminal bug.