Overview
| Artifact ID: | 0f7cfce53a550918a746ff33ca91044d8adfd0ee |
|---|---|
| Ticket: | 1343161fffffffffffffffffffffffffffffffff
exec implemenation fails to close() open file descriptors |
| User & Date: | illumino on 2005-10-31 04:51:26 |
Changes
- assignee changed to: "vincentdarley"
- cmimetype changed to: "text/plain"
- comment changed to:
Tcl/Tk version : 8.4.6 (exists in 8.4.11) Platform: Sun SPARC Solaris 9 In the child section of TclpCreateProcess() in unix/tclUnixPipe.c, after the "pid = fork(); if ( pid ....)" code, the child process sets up std file descriptors, restores signal handling, and executes the new process. Unfortunately, the child leaves all existing file descriptors open! I believe there should be an option (perhaps the default) to close all open file descriptors before exec() so the children (and grandchildren,...) don't inherit them. If it is an option then "exec" will need an interface to this option, to allow the script writer to close all open file descriptors. Regards, Peter Bray Sydney, Australia PS: In our case a UI, which loads a shared library that connects to a server (TCP/IP), used "exec" to start a backgrounded (daemonised actually) copy of firefox to display the user help. LSOF shows that firefox inherited the socket connections and other file descriptors, and when the UI exited, the firefox process still had references to these file descriptors, meaning that the server did not detect a connection close. Trouble ensued and memory and cpu exited stage left... as the server try to buffer data for a client that was not reading from its socket connection.
- foundin changed to: "obsolete: 8.4.11"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "illumino"
- subsystem changed to: "37. File System"
- title changed to:
exec implemenation fails to close() open file descriptors
- type changed to: "RFE"