Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: aae4d36c2bed9152e641ed517903a8db7deb1adc
Ticket: 219327ffffffffffffffffffffffffffffffffff
close $pipe doesn't return non-zero exit status
User & Date: nobody on 2000-10-26 05:10:48
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed 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 changed to: "final: 8.2.3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "60. NRE and coroutines"
  10. title changed to: "close $pipe doesn't return non-zero exit status"
  11. type changed to: "Bug"