GNOME Bugzilla – Bug 351494
Gnome-terminal doesn't kills bash on tab close
Last modified: 2006-08-23 04:02:01 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:
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
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.
Created attachment 70968 [details] Output of the suggested strace command
I've seen this too.
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.
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.