Artifacts Associated With Ticket 219327
Ticket change [aae4d36c2b] (rid 101002) by nobody on 2000-10-26 05:10:48:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 4044 Bug Version: 8.2.3 SubmitDate: '2000-01-19' LastModified: '2000-02-05' Severity: SER Status: UnAssn Submitter: techsupp ChangedBy: hobbs OS: Solaris OSVersion: SunOS 5.5.1 Machine: Sun Ultra 5 FixedDate: '2000-10-25' ClosedDate: '2000-10-25' Name: Mikhail Terekhov Comments: Both tcl8.2.3 and tcl8.3b2 have the same bug. ReproducibleScript: Save the following script as ~/test.tcl proc Pipe_Reader1 { fd } { if [ eof $fd ] { if [ catch { close $fd } message ] { puts "ERROR detected inside fileevent: $message" } else { puts "OK inside fileevent" } global wt set wt 1 } else { puts [ read $fd ]\n } } proc Pipe_Reader2 { fd } { if [ eof $fd ] { global wt set wt 1 } else { puts [ read $fd ]\n } } #====================================================================== global wt set cmd "| cat /xyz" set rc [ catch { open $cmd r } fd ] fconfigure $fd -blocking 0 -buffering line fileevent $fd readable [ list Pipe_Reader1 $fd ] vwait wt set rc [ catch { open $cmd r } fd ] fconfigure $fd -blocking 0 -buffering line fileevent $fd readable [ list Pipe_Reader2 $fd ] vwait wt if [ catch { close $fd } message ] { puts "ERROR detected outside fileevent: $message" } else { puts "OK inside fileevent" } ObservedBehavior: home:> /usr/Local/tcltk.8.3b2/bin/tclsh8.3 ~/test.tcl OK inside fileevent OK inside fileevent home:> /usr/Local/tcltk.8.2.3/bin/tclsh8.2 ~/test.tcl OK inside fileevent OK inside fileevent DesiredBehavior: The same script produces valid results when tcl8.2.1 is used: home:> /usr/Local/tcltk.8.2.1/bin/tclsh8.2 ~/syren/test1.tcl ERROR detected inside fileevent: cat: cannot open /xyz ERROR detected outside fileevent: cat: cannot open /xyz - foundin initialized to: "final: 8.2.3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "60. NRE and coroutines"
- title initialized to: "close $pipe doesn't return non-zero exit status"
- type initialized to: "Bug"
Ticket change [2bd34730bf] (rid 118810) by dgp on 2001-04-05 08:20:11:
- subsystem changed to: "27. Channel Types"
Ticket change [853eb8711f] (rid 131283) by hobbs on 2001-10-17 05:43:37:
- assignee changed to: "andreas_kupries"
Ticket change [42ee4f5d51] (rid 116459) by dgp on 2006-03-10 23:32:04:
- icomment:
Logged In: YES user_id=80530 status?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [6c3280997d] (rid 128459) by andreas_kupries on 2006-03-16 01:10:26:
- foundin changed to: "obsolete: 8.4.12"
- icomment:
Logged In: YES user_id=75003 The behaviour is unchanged for HEAD and 8.4 branch head.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
Ticket change [c858f33291] (rid 122082) by andreas_kupries on 2006-03-17 03:18:01:
- icomment:
Logged In: YES user_id=75003 I believe that the are actually seeing a bug in Tcl 8.2.1. In Nov 29, 1999 Jeff Hobbs fixed a problem in tclUnixPipe, apparently the blocking mode of the channel was not properly set before. So, a channel with -blocking 0 does not report errors. See tclUnixPipe.c, PipeCloseProc. This code is present in Tcl 8.2.1 as well, in unchanged form. 8.2.1 reported the error despite this because of the bad information it had about the blocking mode of the pipe. To get the error from the pipe run fconfigure -blocking 1 $fd close $fd instead of just a 'close $fd'. I have to admit that the manpage of close is written poorly when it comes to explaining the handling of -blocking. The behaviour is descried in the the manpage of open, in the section about command pipelines. I recommend to try and fix the documentation. The core is ok, and the example script simply falls into a trap for the unwary. I will not mind if this bug is simply closed. As described by the submitter it is 'Invalid'. - login: "andreas_kupries"
- mimetype: "text/plain"
- priority changed to: "2"
- resolution changed to: "Invalid"
- username: "andreas_kupries"
- icomment:
Ticket change [fc1e2afaa9] (rid 108172) by andreas_kupries on 2006-03-17 03:28:56:
- closedate changed to: "2006-03-16T20:28:56"
- closer changed to: "andreas_kupries"
- status changed to: "Pending"
Ticket change [232087a1f3] (rid 130865) by sf-robot on 2006-03-31 10:20:55:
- closedate changed to: "2006-03-31T03:20:55"
- closer changed to: "sf-robot"
- icomment:
Logged In: YES user_id=1312539 This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).
- login: "sf-robot"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "sf-robot"