gnome-terminal "gives too many open files" error after running for a long time, with frequent open/close of terminal window

Bug #663364 reported by Jeff Zheng
68
This bug affects 14 people
Affects Status Importance Assigned to Milestone
GNOME Terminal
Fix Released
High
vte (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: gnome-terminal

After long usage of gnome-terminal without terminating the process, gnome-terminal gives "too many open files" error when open a new terminal.

Looking at the /proc/xxxx/fd, it seems that all opened /dev/pts/xxx and /dev/ptmx are left unclosed when an terminal window/tab is closed.

what I get from /proc/xxxx/fd is hundreds of opened fd

lrwx------ 1 jeff.zheng users 64 2010-10-19 23:55 80 -> /dev/ptmx
lrwx------ 1 jeff.zheng users 64 2010-10-19 23:55 81 -> /dev/pts/29
lrwx------ 1 jeff.zheng users 64 2010-10-19 23:55 82 -> /dev/ptmx
lrwx------ 1 jeff.zheng users 64 2010-10-19 23:55 83 -> /dev/pts/30
lrwx------ 1 jeff.zheng users 64 2010-10-19 23:55 84 -> /dev/ptmx
lrwx------ 1 jeff.zheng users 64 2010-10-19 23:55 85 -> /dev/pts/31
lrwx------ 1 jeff.zheng users 64 2010-10-19 23:55 86 -> /dev/ptmx
lrwx------ 1 jeff.zheng users 64 2010-10-19 23:55 87 -> /dev/pts/32
lrwx------ 1 jeff.zheng users 64 2010-10-19 23:55 88 -> /dev/ptmx
lrwx------ 1 jeff.zheng users 64 2010-10-19 23:55 89 -> /dev/pts/33

to reproduce, open gnome-terminal, open a new tabe by ctrl+shift+t, then close the newly opened tab, then look at the /proc/xxx/fd, you can see the newly opened fds are left unclosed.

After a long run with frequenct open/close of terminal, you'll "too many open files" error

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: gnome-terminal 2.32.0-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-22.34-generic 2.6.35.4
Uname: Linux 2.6.35-22-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Tue Oct 19 23:56:01 2010
ExecutablePath: /usr/bin/gnome-terminal
ProcEnviron:
 LANGUAGE=en_US:en
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: gnome-terminal

Revision history for this message
Jeff Zheng (zhengzhe79) wrote :
Revision history for this message
Jeff Zheng (zhengzhe79) wrote :

Here's the opened file list when it starts failing

Brian Fuller (slink3r)
Changed in gnome-terminal (Ubuntu):
status: New → Confirmed
Revision history for this message
Pedro Villavicencio (pedro) wrote :

according to upstream, that's a vte issue rather. reassigning.

affects: gnome-terminal (Ubuntu) → vte (Ubuntu)
Changed in vte (Ubuntu):
importance: Undecided → Low
status: Confirmed → Triaged
Changed in gnome-terminal:
importance: Unknown → High
status: Unknown → Fix Released
Revision history for this message
Jeff Zheng (zhengzhe79) wrote :

Is ubuntu going to do something with this bug? It is affecting me, and I'm hesitating on upgrade the machines to 10.10 or future releases.

Changed in vte (Ubuntu):
status: Triaged → Confirmed
status: Confirmed → New
Jeff Zheng (zhengzhe79)
Changed in vte (Ubuntu):
status: New → Fix Released
Revision history for this message
ward (ward-pong) wrote :

I assume the fix is in the latest natty packages. Can we please get a backport to maverick? This bug is extremely annoying.

Revision history for this message
pmeerw (pmeerw) wrote :

on maverick with all updates applied:

when opening a new terminal:
There was an error creating the child process for this terminal
Failed to create pipe for communicating with child process (Too many open files)

lsof | grep ptmx | wc -l
463

this is annoying, it kills my uptime :)

Revision history for this message
ward (ward-pong) wrote :

For the record, the fix is trivial; it's a one line patch. You can find it here:

   http://git.gnome.org/browse/vte/commit/?h=vte-0-26&id=c5ff71e924d7b3598e332392c4cc4c19e89a7d6f

I just ended up rebuilding my libvte9 package with the patch, and the problem is gone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.