Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0f1d688e75553f3788af7b7e6f17932f457300cd
Ticket: 218588ffffffffffffffffffffffffffffffffff
application hangs on non-blocking command channel
User & Date: nobody on 2000-10-26 01:02:47
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 1356 Bug
    Version: 8.0.3
    SubmitDate: '1999-03-02'
    LastModified: '1999-12-03'
    Severity: CRIT
    Status: Released
    Submitter: pat
    ChangedBy: hobbs
    RelatedBugIDs: 710
    OS: Solaris
    OSVersion: 2.5.1
    Machine: Other
    FixedDate: '1999-12-03'
    FixedInVersion: 8.2.3
    ClosedDate: '2000-10-25'
    
    
    Name: Jean M. Brouwers
    
    ObservedBehavior:
    After opening a command channel and after setting the channel option to non-blocking, the application hangs, occasionally.  It turns out that system call waitpid() is being called with the options argument set to 0 and not WNOHANG.
    
    The call stack shows that waitpid() is called from
    TclCleanupChildren (in tclPipe.c), which is called by
    PipeCloseProc (in tclUnixPipe.c),
    CloseChannel (in tclIO.c),
    FlushChannel (intclIO.c), and ultimately
    Tcl_Close (in tclIO.c)
    
    DesiredBehavior:
    Tcl_Close should not be waiting for any child processes to finish if the command channel option is non-blocking.
    
    Closer inspection of the source code shows that PipeCloseProc does include the correct handling of this situation if flag isNonBlocking of the PipeState is set to non-zero.  However, that flag is never set to anything else than zero.
    
    
    
    Proposed remedy:  function PipeBlockModeProc (in tclUnixPipe.c) should set the flag isNonBlcoking correctly depending on the value of the mode argument passed in.
    ---
    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: "application hangs on non-blocking command channel"
  11. type changed to: "Bug"