Overview
| Artifact ID: | 0f1d688e75553f3788af7b7e6f17932f457300cd |
|---|---|
| Ticket: | 218588ffffffffffffffffffffffffffffffffff
application hangs on non-blocking command channel |
| User & Date: | nobody on 2000-10-26 01:02:47 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- 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 - foundin changed to: "obsolete: 8.0.3"
- 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: "application hangs on non-blocking command channel"
- type changed to: "Bug"