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 777007 - gnome-terminal leaks pts when closing tabs
gnome-terminal leaks pts when closing tabs
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-08 12:32 UTC by Ting-Wei Lan
Modified: 2017-01-08 12:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ting-Wei Lan 2017-01-08 12:32:32 UTC
Description copied from https://bugzilla.gnome.org/show_bug.cgi?id=772354#c19.

Recent commit d4e25a5 causes GNOME Terminal to leak a pts when a tab is closed. After using it for several days, I have 4 tabs but with hundreds of pts in /dev/pts.

Steps to Reproduce:
1. Start terminal with 3 tabs and type 'tty' command in each tab. My result is /dev/pts/25, /dev/pts/26, /dev/pts/27.
2. Close the first tab (/dev/pts/25) and we have 2 tabs left in this step.
3. Open a new tab. We have 3 tabs again in this step.

Expected Results:
The newly opened tab should reuse the recently closed pts (/dev/pts/25).

Actual Results:
The newly opened tab use /dev/pts/28, and /dev/pts/25 still exists. On FreeBSD, you can run 'procstat -f <pid>' and see 4 pts are opened by gnome-terminal-server. The same problem also happens on Linux, but I don't know which command can be used to show the name of opened pts. 'lsof -p <pid>' and 'ls -l /proc/<pid>/fd' only show /dev/ptmx.

$ procstat -f 33650
  PID COMM                FD T V FLAGS    REF  OFFSET PRO NAME
33650 gnome-terminal-serv  text v r r-------   -       - -   /home/lantw44/gnome/devinstall/libexec/gnome-terminal-server
33650 gnome-terminal-serv   cwd v d r-------   -       - -   /home/lantw44
33650 gnome-terminal-serv  root v d r-------   -       - -   /
...
33650 gnome-terminal-serv    23 t - rw---n--   1       0 -   pts/25
33650 gnome-terminal-serv    24 t - rw---n--   1       0 -   pts/26
33650 gnome-terminal-serv    25 t - rw---n--   1       0 -   pts/27
33650 gnome-terminal-serv    26 t - rw---n--   1       0 -   pts/28
Comment 1 Christian Persch 2017-01-08 12:39:55 UTC
Fixed on master.