Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a935be57bba1a5b0b51343cc68c3abcfc4fd16a1
Ticket: 218492ffffffffffffffffffffffffffffffffff
close waits for process to complete (should reap in backgrou
User & Date: nobody on 2000-10-26 01:01:17
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 710 Bug
    Version: 8.0.3
    SubmitDate: '1998-10-13'
    LastModified: '1999-12-03'
    Severity: SER
    Status: Released
    Submitter: admin
    ChangedBy: hobbs
    RelatedBugIDs: 1356 1417 1682 5924
    OS: All Unix
    FixedDate: '1999-12-03'
    FixedInVersion: 8.2.3
    ClosedDate: '2000-10-25'
    
    
    This is a bug that was officially fixed  at 7.5p1 (below is  an entry
    in the 'changes' file:)
    
      6/10/96 (bug fix) Changes the Tcl close command so that it no longer
      waits on nonblocking pipes for the piped processes to exit; instead it
      reaps them in the background. (JL)
    
    Today, 8.0.3, at least on  Solaris and NT, but I think also everywhere
    else, the following code blocks on close:
    
            set f [open "|cmd" r]
            fconfigure $f -blocking 0
            close $f
    
    (where cmd is something that sleeps, writing nothing, e.g. sleep 9999)
    
    So  the  problem  is  what's  called  'reaping  in   the  background'.
    Apparently (looking at the source) it is done in foreground.
    
     Note anyway that  on unix  at  least, all this is  handled in  a very
    strange way.  A more natural  implementation would register  a SIGCHLD
    handler which would *then* trigger the reaping.
    
    
    4/17/99 - redman - confirmed on NT with 8.1b3+.  The close is waiting for the process to complete.
    
    >My vote:  although it's an annoying little problem,
    >it's been there for a while and will take too much
    >time to fix for 8.1.  Maybe we can get to these in
    >8.1.1. -- Scott R.
    
    Confirmed with 8.2 on Sol7. 
    -- 10/21/1999 hobbs
    
    Adding
        psPtr->isNonBlocking = (mode == TCL_MODE_NONBLOCKING);
    before the return in unix/tclUnixPipe.c:PipeBlockModeProc
    seems to solve the problem. 
    -- 11/29/1999 hobbs
    
    
    
  4. foundin changed to: "obsolete: 8.0.3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "60. NRE and coroutines"
  10. title changed to:
    close waits for process to complete (should reap in backgrou
    
  11. type changed to: "Bug"