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 632257 - Gnome-terminal leaks file descriptors
Gnome-terminal leaks file descriptors
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.26.x
Other Linux
: Normal major
: ---
Assigned To: VTE Maintainers
VTE Maintainers
fixed-0-26
: 632584 632689 633488 635689 638818 640084 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-10-15 20:58 UTC by Seva Epsteyn
Modified: 2011-08-06 02:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Listing of file descriptors file /proc (36.47 KB, text/plain)
2010-10-15 20:59 UTC, Seva Epsteyn
Details
valgrind (49.42 KB, text/plain)
2010-10-15 22:15 UTC, Seva Epsteyn
Details

Description Seva Epsteyn 2010-10-15 20:58:10 UTC
gnome-terminal-2.32.0-1.fc14.x86_64

Eventually becomes unable to open new windows even if there are only a few windows currently open.

Easy to reproduce:

 1. Open gnome-terminal
 2. Check FD usage
      ls /proc/$(pidof gnome-terminal)/fd | wc -l
      31
 3. Open a bunch of new windows and close them all
      This is easy via empty virtual desktop and keyboard shortcut like Super-x
      gconftool-2 -s /apps/metacity/keybinding_commands/command_1 --type string "gnome-terminal"
     gconftool-2 -s /apps/metacity/global_keybindings/run_command_1 --type string "<Super>x"
 4. Close all new windows (press Ctrl-d a lot)
 5. Check FD usage
      $ ls /proc/$(pidof gnome-terminal)/fd | wc -l
      635
Comment 1 Seva Epsteyn 2010-10-15 20:59:03 UTC
Created attachment 172456 [details]
Listing of file descriptors file /proc

This is after opening a lot of new windows then closing them.
Comment 2 Seva Epsteyn 2010-10-15 21:02:54 UTC
In my case, open files limit is set to 1024 via:
  ulimit -n 1024
Comment 3 Christian Persch 2010-10-15 21:49:26 UTC
Please run gnome-terminal (with --disable-factory option!) under valgrind as detailed on http://live.gnome.org/Valgrind and add the --track-fds=yes option, and attach the log here. (Do install the debug symbols for glib, gdk-pixbuf, gtk, pango, cairo, vte, gnome-terminal etc first, so the valgrind log is useful.)
Comment 4 Christian Persch 2010-10-15 22:04:08 UTC
Actually I just found one problem, which might have caused this. Try either with vte from git master (or wait for 0.26.2 / 0.27.next).
Comment 5 Seva Epsteyn 2010-10-15 22:15:12 UTC
I used " G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --tool=memcheck --num-callers=20 --log-file=vgdump  --track-fds=yes --track-origins=yes gnome-terminal"

If I --disable-factory each new terminal is a separate process...
Comment 6 Seva Epsteyn 2010-10-15 22:15:48 UTC
Created attachment 172462 [details]
valgrind

 G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --tool=memcheck --num-callers=20 --log-file=vgdump  --track-fds=yes --track-origins=yes gnome-terminal
Comment 7 Seva Epsteyn 2010-10-15 22:26:02 UTC
Just in case someone else is searching for this, it manifests in being unable to open a new window with the following error message:

"There was an error creating the child process for this terminal"

"Failed to create pipe for communicating with child process (Too many open files)"
Comment 8 Christian Persch 2010-10-19 17:58:44 UTC
Should be fixed in 0.27.1, and will be in 0.26.2 release.
Comment 9 Christian Persch 2010-10-19 17:59:00 UTC
*** Bug 632584 has been marked as a duplicate of this bug. ***
Comment 10 Christian Persch 2010-10-20 14:55:50 UTC
*** Bug 632689 has been marked as a duplicate of this bug. ***
Comment 11 Christian Persch 2010-10-29 18:40:37 UTC
*** Bug 633488 has been marked as a duplicate of this bug. ***
Comment 12 Christian Persch 2010-11-24 12:42:34 UTC
*** Bug 635689 has been marked as a duplicate of this bug. ***
Comment 13 Christian Persch 2011-01-06 12:13:14 UTC
*** Bug 638818 has been marked as a duplicate of this bug. ***
Comment 14 Christian Persch 2011-01-20 17:14:10 UTC
*** Bug 640084 has been marked as a duplicate of this bug. ***
Comment 15 pengyu.ut 2011-08-06 02:41:38 UTC
It seems that this bug should have been fixed in the following version of gnome-terminal. But I still see the error "Failed to create pipe for communicating with child process (Too many open files)". Does anybody know what the problem is?


$ aptitude show gnome-terminal
Package: gnome-terminal                  
State: installed
Automatically installed: no
Version: 2.32.1-0ubuntu3
Priority: optional
Section: gnome
Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>
Uncompressed Size: 442 k
Depends: libatk1.0-0 (>= 1.12.4), libc6 (>= 2.4), libgconf2-4 (>= 2.31.1),
         libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.26.0), libgtk2.0-0
         (>= 2.20.0), libice6 (>= 1:1.0.0), liblaunchpad-integration1 (>=
         0.1.17), libpango1.0-0 (>= 1.14.0), libsm6, libvte9 (>= 1:0.24.0),
         libx11-6, gnome-terminal-data (>= 2.32), gnome-terminal-data (< 2.33)
Recommends: yelp, gvfs
Replaces: gnome-terminal-data (< 2.28.1-1ubuntu1)
Provides: x-terminal-emulator
Description: The GNOME terminal emulator application
 GNOME Terminal is a terminal emulation application that you can use to perform
 the following actions: 
 * Access a UNIX shell in the GNOME environment. 
 * Run any application that is designed to run on VT102, VT220, and xterm 
 terminals. 
 
 GNOME Terminal features the ability to use multiple terminals in a single
 window (tabs) and profiles support.