Tcl Source Code

View Ticket
Login
Ticket UUID: 21dbc600ae0a005a7f879a05580550a8da257b14
Title: exec hangs, iff stdin & stdout both were previously closed.
Type: Bug Version: 8.6.8
Submitter: avl42 Created on: 2022-12-06 11:45:49
Subsystem: 16. Commands A-H Assigned To: nobody
Priority: 5 Medium Severity: Severe
Status: Open Last Modified: 2022-12-06 12:06:26
Resolution: None Closed By: nobody
    Closed on:
Description:
simplest test script:
   close stdin; close stdout; exec true

Workaround (assuming that original stdin & -out just need to be closed):
   close stdin; close stdout; open /dev/null r; exec true

In either case: exec first creates a pipe, and while the child runs,
the parent waits on that pipe for EOF (probably to be initiated
from another thread).

With at least one of stdin or stdout NOT closed (or re-opened afterwards),
the EOF on that pipe is seen, but with BOTH stdin/-out closed, nothing
ever closes the write-end of the pipe.

PS: that pipe is NOT the one by which the main process communicates to the child.