Overview
| Artifact ID: | 1e394a37e86c12d1e85195b53f45cd4d9ace40de |
|---|---|
| Ticket: | 219118ffffffffffffffffffffffffffffffffff
failed exec leaves defunct process |
| User & Date: | nobody on 2000-10-26 01:11:03 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 6148 Bug Version: 8.3.2 SubmitDate: '2000-08-18' LastModified: '2000-09-06' Severity: MED Status: Released Submitter: techsupp ChangedBy: hobbs RelatedBugIDs: 5759 OS: Solaris OSVersion: Solaris 2.7 Machine: multiprocessor Sparc (E450 I think) FixedDate: '2000-09-06' FixedInVersion: 8.4a2 ClosedDate: '2000-10-25' Name: Rob Mayoff Comments: The problem is that the child writes its error code to the pipe and then exits. The parent reads the code and then calls waidpid with the WNOHANG flag. The problem is that the parent might read the code and call waitpid before the child has reached the exit call, in which case waidpid returns 0. There is no reason for the parent to use the WNOHANG flag. Eliminating the WNOHANG flag removes the race condition. This problem also exists in Tcl 7.6. ReproducibleScript: # Run this in an interactive tclsh: for {set i 0} {$i < 100} {incr i} { catch {exec /this/file/does/not/exist} } ObservedBehavior: On a multiprocessor Solaris machine, when an exec fails, there is a possibility of the failed child not being waited on and hanging around as a zombie (defunct process), due to a race condition. The sample script above generated about 33 zombies in one test. DesiredBehavior: No zombies! Patch: *** tclUnixPipe.c 2000/08/15 01:11:05 1.1.1.1 --- tclUnixPipe.c 2000/08/15 03:57:23 1.2 *************** *** 447,453 **** * startup. */ ! Tcl_WaitPid((Tcl_Pid) pid, &status, WNOHANG); } if (errPipeIn) { --- 447,453 ---- * startup. */ ! Tcl_WaitPid((Tcl_Pid) pid, &status, 0); } if (errPipeIn) { PatchFiles: unix/tclUnixPipe.c Fixed in 8.4a2. -- 09/06/2000 hobbs - foundin changed to: "obsolete: 8.3.2"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "60. NRE and coroutines"
- title changed to: "failed exec leaves defunct process"
- type changed to: "Bug"