Overview
| Artifact ID: | 43337064607a25e7f1a6a77cc394c3f6ca37a909 |
|---|---|
| Ticket: | 653218ffffffffffffffffffffffffffffffffff
Channels CloseProc() not called on close |
| User & Date: | schroedter on 2002-12-13 11:54:58 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- comment changed to:
If there is pending BG output for a non-blocking channel then Tcl_DriverCloseProc() is not called when the 'close' command is invoked. That can be seen from generic/tclIO.c : Tcl_Unregister_Channel(): if (!(statePtr->flags & BG_FLUSH_SCHEDULED)) { ... This can be very bad if channel's output is stalled, e.g. a serial port blocked by handshake: % puts "Tcl $tcl_patchLevel" Tcl 8.4b1 % set chan [open com1: r+] fileaaf550 % fconfigure $chan -buffering none -blocking 0 % fconfigure $chan -mode 1200,n,8,1 -handshake rtscts % ### 2 outputs: "hello world" \x0D\x0A, BG_FLUSH % puts $chan "hello world" % puts "Queue: [fconfigure $chan -queue]" Queue: 0 13 % after 1000 % puts "Queue: [fconfigure $chan -queue]" Queue: 0 13 % close $chan % set chan [open com1: r+] couldn't open "com1:": permission denied % This problem occurs also for slow output without handshake: % puts "Tcl $tcl_patchLevel" Tcl 8.4b1 % set chan [open com1: r+] fileaaf768 % fconfigure $chan -buffering none -blocking 0 % # Explicitely reset handshake=none % fconfigure $chan -mode 1200,n,8,1 -handshake none % puts $chan "hello world" % puts $chan "hello world" % close $chan % set chan [open com1: r+] couldn't open "com1:": permission denied For Tcl < 8.4. this has never been observed for serial ports, because serial output has already been blocking. - foundin changed to: "obsolete: 8.4.1"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "schroedter"
- subsystem changed to: "25. Channel System"
- title changed to: "Channels CloseProc() not called on close"
- type changed to: "Bug"