Skip to content
Tcl Source Code History Of Ticket 2b6b0a
Login

History Of Ticket 2b6b0a

Artifacts Associated With Ticket 2b6b0a

  1. Ticket change [7d7a6294d9] (rid 258296) by serhiy.storchaka on 2026-10-16 21:22:15:

    1. cmimetype initialized to: "text/x-fossil-wiki"
    2. comment initialized 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.
      
    3. foundin initialized to: "8.6.18, 9.0.5, 9.1.0"
    4. login: "serhiy.storchaka"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. severity initialized to: "Minor"
    8. status initialized to: "Open"
    9. submitter initialized to: "serhiy.storchaka"
    10. subsystem initialized to: "25. Channel System"
    11. title initialized to:
      writes accepted after non-blocking chan close write
      
    12. type initialized to: "Bug"
  2. Ticket change [8607a861af] (rid 258302) by serhiy.storchaka on 2026-10-16 21:29:43:

    1. icomment:
      Proposed fix in branch [/timeline?r=chan-close-write-pending|chan-close-write-pending]: Tcl_GetChannelMode() does not report the write side once it is closed, so <nowiki>[puts]</nowiki> and a second <nowiki>[chan close $chan write]</nowiki> fail as for a blocking channel; the queued output is still flushed. Test iocmd-7.6.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
  3. Ticket change [bc99893964] (rid 261980) by jan.nijtmans on 2026-11-20 16:41:51:

    1. assignee changed to: "aku"
    2. closer changed to: "nobody"
    3. 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.
      
    4. icomment: "Merged to [a98d8d4e44|trunk]."
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Fixed"
    8. status changed to: "Pending"
  4. Ticket change [9e463c5705] (rid 262029) by jan.nijtmans on 2026-11-22 22:55:52:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2461367.4554717359"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      Merged to [a98d8d4e44|trunk], core-9-0-branch and core-8-6-branch
      
      Many thanks!
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. status changed to: "Closed"