GNOME Bugzilla – Bug 632257
Gnome-terminal leaks file descriptors
Last modified: 2011-08-06 02:41:38 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
Created attachment 172456 [details] Listing of file descriptors file /proc This is after opening a lot of new windows then closing them.
In my case, open files limit is set to 1024 via: ulimit -n 1024
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.)
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).
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...
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
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)"
Should be fixed in 0.27.1, and will be in 0.26.2 release.
*** Bug 632584 has been marked as a duplicate of this bug. ***
*** Bug 632689 has been marked as a duplicate of this bug. ***
*** Bug 633488 has been marked as a duplicate of this bug. ***
*** Bug 635689 has been marked as a duplicate of this bug. ***
*** Bug 638818 has been marked as a duplicate of this bug. ***
*** Bug 640084 has been marked as a duplicate of this bug. ***
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.