Skip to content
Tcl Source Code History Of Ticket 219327ffffffffff
Login

History Of Ticket 219327ffffffffff

Artifacts Associated With Ticket 219327ffffffffff

  1. Ticket change [aae4d36c2b] (rid 101002) by nobody on 2000-10-26 05:10:48:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
      
      
      
      
    4. foundin initialized to: "final: 8.2.3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "60. NRE and coroutines"
    10. title initialized to: "close $pipe doesn't return non-zero exit status"
    11. type initialized to: "Bug"
  2. Ticket change [2bd34730bf] (rid 118810) by dgp on 2001-04-05 08:20:11:

    1. subsystem changed to: "27. Channel Types"
  3. Ticket change [853eb8711f] (rid 131283) by hobbs on 2001-10-17 05:43:37:

    1. assignee changed to: "andreas_kupries"
  4. Ticket change [42ee4f5d51] (rid 116459) by dgp on 2006-03-10 23:32:04:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      status?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [6c3280997d] (rid 128459) by andreas_kupries on 2006-03-16 01:10:26:

    1. foundin changed to: "obsolete: 8.4.12"
    2. icomment:
      Logged In: YES 
      user_id=75003
      
      The behaviour is unchanged for HEAD and 8.4 branch head.
      
      
      
    3. login: "andreas_kupries"
    4. mimetype: "text/plain"
    5. username: "andreas_kupries"
  6. Ticket change [c858f33291] (rid 122082) by andreas_kupries on 2006-03-17 03:18:01:

    1. 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'.
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. priority changed to: "2"
    5. resolution changed to: "Invalid"
    6. username: "andreas_kupries"
  7. Ticket change [fc1e2afaa9] (rid 108172) by andreas_kupries on 2006-03-17 03:28:56:

    1. closedate changed to: "2006-03-16T20:28:56"
    2. closer changed to: "andreas_kupries"
    3. status changed to: "Pending"
  8. Ticket change [232087a1f3] (rid 130865) by sf-robot on 2006-03-31 10:20:55:

    1. closedate changed to: "2006-03-31T03:20:55"
    2. closer changed to: "sf-robot"
    3. 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).
      
      
    4. login: "sf-robot"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "sf-robot"