Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 19f032ff3bed10478710c4c5f773011d416403ebd55c96161369066b380b58f0
Ticket: 9b67dc961892c8494218ee7eef4b30b08ccef865
socket-14.11.* write before being notified that the channel is ready
User & Date: pooryorick on 2024-08-26 16:13:09
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    In the following excerpt socket.test/socket-14.11.0, <code>puts</code> is
    called before any notification is received that the channel is ready for
    writing:
    
    <code><verbatim>
    set sock [socket -async localhost [randport]]                                                                                                                                                                                                                                                                          
    fconfigure $sock -blocking 0                                                                                                                                                                                                                                                                                           
    puts $sock ok
    </verbatim></code>
    
    This is contraindicated in the documentation: "The application must use the Tcl
    event loop for non-blocking output to work; otherwise Tcl never finds out that
    the file or device is ready for more output data. It is possible for an
    arbitrarily large amount of data to be buffered for a channel in non-blocking
    mode, which could consume a large amount of memory. To avoid wasting memory,
    non-blocking I/O should normally be used in an event-driven fashion with the
    chan event command (do not invoke chan puts unless you have recently been
    notified via a file event that the channel is ready for more output data)."
    
    Therefore, socket-14.11.0 and 14.11.1 are testing undefined behaviour.
    
  5. is_private changed to: "0"
  6. login: "pooryorick"
  7. priority changed to: "5 Medium"
  8. private_contact changed to: "ace48c675e6d9823c38a3aa91ffddc0ff84cc79f"
  9. resolution changed to: "None"
  10. severity changed to: "Important"
  11. status changed to: "Open"
  12. submitter changed to: "pooryorick"
  13. subsystem changed to: "24. Channel Commands"
  14. title changed to:
    socket-14.11.* write before being notified that the channel is ready
    
  15. type changed to: "Bug"