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 351494 - Gnome-terminal doesn't kills bash on tab close
Gnome-terminal doesn't kills bash on tab close
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.13.x
Other All
: Normal critical
: ---
Assigned To: Behdad Esfahbod
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-08-15 16:17 UTC by Gabor Kelemen
Modified: 2006-08-23 04:02 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Output of the suggested strace command (3.16 KB, text/plain)
2006-08-15 18:04 UTC, Gabor Kelemen
Details

Description Gabor Kelemen 2006-08-15 16:17:19 UTC
Please describe the problem:
When closing a tab, the bash instance it contained doesn't gets killed, leaking 2Mb memory per tab. Also, if i run something (make for example) from the closed tab, it keeps running too.

Steps to reproduce:
1. Run gnome-terminal. 
2. Open some tabs. 
3. Close them. 

Actual results:
In the system monitor, one can see the bash instances started by the terminal keep running.


Expected results:
Bash instances get killed.

Does this happen every time?
Yes

Other information:
Comment 1 Rob Bradford 2006-08-15 17:05:22 UTC
Hhhm. I can't reproduce this myself here (2.15.4). What version are you using?

A good means to check this out would be to run gnome-terminal under strace:

strace -f -e fork,wait4,kill gnome-terminal


Comment 2 Gabor Kelemen 2006-08-15 18:02:59 UTC
I'm using 2.15.4 from Ubuntu package, but the attached output of your strace line is from HEAD. I opened a gnome-terminal from xterm, opened two tabs, and issued the following:

gabor@ubuntu:~$ ps aux | grep bash
gabor     7321  0.0  0.6   5752  3444 pts/0    Ss   21:48   0:00 bash
gabor     7649  0.2  0.6   5756  3444 pts/1    Ss+  21:54   0:00 bash
gabor     7675  0.2  0.6   5760  3448 pts/2    Ss+  21:54   0:00 bash
gabor     7716  0.4  0.6   5760  3452 pts/3    Ts   21:54   0:00 bash
gabor     7768  0.0  0.1   2756   728 pts/3    S+   21:55   0:00 grep bash

then closed the first two, and:

gabor@ubuntu:~$ ps aux | grep bash
gabor     7321  0.0  0.6   5752  3444 pts/0    Ss   21:48   0:00 bash
gabor     7649  0.2  0.6   5756  3444 pts/1    Ss+  21:54   0:00 bash
gabor     7675  0.2  0.6   5760  3448 pts/2    Ss+  21:54   0:00 bash
gabor     7716  0.3  0.6   5760  3452 pts/3    Ts   21:54   0:00 bash
gabor     7779  0.0  0.0    288    16 pts/3    R+   21:55   0:00 grep bash
gabor@ubuntu:~$ 

after closing the g-t window, on the xterm:
gabor@ubuntu:~$ ps aux | grep bash
gabor     7321  0.0  0.6   5752  3444 pts/0    Ss   21:48   0:00 bash
gabor     7828  0.0  0.1   2756   716 pts/0    R+   21:57   0:00 grep bash

So basically, i can reproduce it on HEAD. 
Comment 3 Gabor Kelemen 2006-08-15 18:04:41 UTC
Created attachment 70968 [details]
Output of the suggested strace command
Comment 4 Behdad Esfahbod 2006-08-16 23:06:53 UTC
I've seen this too.
Comment 5 Behdad Esfahbod 2006-08-22 07:21:14 UTC
This is caused by the fix in bug 348814 (that itself was committed to bug another regression!)  Copying my comment:

Aivars,

The fix here causes a reference cycle between the vte widget and the draw
object, causing that neither is ever freed, causing Bug 351494.

I was going to use weak refs in draw to not keep the widget frome being
finalized, but then I figured that I think we really should dispose and
recreate draw in unrealize/realize, because the display may change in between. 
That's the entire point of unrealize/realize.

Can you rework your font stuff to fix this?  We are almost in code freeze now,
so I have to take the safes route to an stable release for GNOME 2.16 as soon
as possible.  Thanks.
Comment 6 Behdad Esfahbod 2006-08-23 04:02:01 UTC
Committed attachment 71392 [details] [review].

2006-08-22  Behdad Esfahbod  <behdad@gnome.org>

        Bug 351494 – Gnome-terminal doesn't kills bash on tab close
        Patch from Aivars Kalvans

        * src/vte.c (vte_terminal_unrealize): Undo the change from bug 348814.
        Dispose draw in unrealize again, but also set has_fonts to FALSE.