GNOME Bugzilla – Bug 640084
pty file descriptor leak in gnome-terminal
Last modified: 2011-01-20 17:14:10 UTC
gnome-terminal opens, but never closes, ptys for its windows. I tagged this 2.32.x, which is the version I'm running, but I've verified by source code examination that the bug still exists in 2.33.4. How to reproduce: * Watch the contents of /dev/pts/ while doing the following: * Start up gnome-terminal. * Open several new tabs/windows (these new windows are managed by the original gnome-terminal process). Watch as pty's are created in the /dev/pts/ directory. * Close some of those tabs/windows. Notice that the pty's never get freed. * Close ALL tabs/windows, or kill the gnome-terminal process. The pty's are finally freed up. Examining the source code (grep for the string "pty_fd"), notice that it gets opened by vte_terminal_get_pty, but nowhere does it ever get passed to close(). How I noticed this (i.e. how it affected me): This caused firefox to hang. I had started firefox by entering the shell command "firefox & exit" in a gnome-terminal. Firefox later tried to write some messages to stderr, and the write() blocked. (Gnome-terminal was sitting on the leaked ptmx file descriptor, and the buffer filled up.) Closing all of my gnome-terminal windows unfroze firefox.
*** This bug has been marked as a duplicate of bug 632257 ***