Skip to content
Tcl Source Code History Of Ticket 219118ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 219118ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 219118ffffffffffffffffffffffffffffffffff

  1. Ticket change [1e394a37e8] (rid 90938) by nobody on 2000-10-26 01:11:03:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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
      
    4. foundin initialized to: "obsolete: 8.3.2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "60. NRE and coroutines"
    10. title initialized to: "failed exec leaves defunct process"
    11. type initialized to: "Bug"
  2. Ticket change [9c6e48fbe2] (rid 96147) by welch on 2000-10-26 08:34:57:

    1. closedate changed to: "2000-10-26T01:34:57"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [1db2997356] (rid 90857) by dgp on 2001-04-05 08:20:12:

    1. closedate changed to: "2001-04-05T01:20:12"
    2. closer changed to: "dgp"
    3. subsystem changed to: "27. Channel Types"