Overview
| Artifact ID: | 7d7a6294d91a39b56191075c381b89bf674ac536712e680ebfc13fc9251198de |
|---|---|
| Ticket: | 2b6b0a57296aecf267d19554a6a0c6f2ac83efbc
writes accepted after non-blocking chan close write |
| User & Date: | serhiy.storchaka on 2026-10-16 21:22:15 |
Changes
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
After <nowiki>[chan close $chan write]</nowiki> on a non-blocking channel with output still queued, the channel stays writable until the background flush finishes: <nowiki>[puts]</nowiki> is accepted and the data is sent after the half-close. <verbatim> set p [open |[list [info nameofexecutable] child.tcl] r+] ;# child reads stdin later fconfigure $p -blocking 0 puts -nonewline $p [string repeat a 1000000] chan close $p write ;# returns at once, output still pending puts $p AFTER ;# no error; the child receives "AFTER" </verbatim> A blocking channel gives "channel wasn't opened for writing". CloseWrite() sets CHANNEL_CLOSEDWRITE, but TCL_WRITABLE is reset only when the flush completes (CloseChannelPart), and neither Tcl_GetChannelMode() nor CheckChannelErrors() looks at CHANNEL_CLOSEDWRITE. Seen with pipes and sockets.
- foundin changed to: "8.6.18, 9.0.5, 9.1.0"
- login: "serhiy.storchaka"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "serhiy.storchaka"
- subsystem changed to: "25. Channel System"
- title changed to:
writes accepted after non-blocking chan close write
- type changed to: "Bug"