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

History Of Ticket 218484ffffffffff

Artifacts Associated With Ticket 218484ffffffffff

  1. Ticket change [ee07b8785f] (rid 104011) by nobody on 2000-10-26 01:01:07:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 692 Bug
      Version: 8.0.3
      SubmitDate: '1998-10-02'
      LastModified: '1999-12-03'
      Severity: SER
      Status: Released
      Submitter: hershey
      ChangedBy: hobbs
      OS: All
      OSVersion: NA
      Machine: NA
      FixedDate: '1999-12-03'
      FixedInVersion: 8.0.5
      ClosedDate: '2000-10-25'
      
      
      Following examples discussed in c.l.t, and documented at
      <URL: ftp://ftp.neosoft.com/pub/tcl/sorted/text/tclarch.txt>, I've
      been using [open |] + [fileevent] for inter-process communication,
      and I've used [catch {close $pipe}] to get the exit status of the
      child process.  I'm sad to report that this mechanism is broken
      in Tcl 8.0.3, as the following short example will demonstrate:
      
      visage:tmp: cat child.tcl 
      #!/bin/sh 
      #  exec tclsh "$0" ${1+"$@"}
      puts stderr "Msg to stderr"
      puts stdout "Msg to stdout"
      exit 1
      
      visage:tmp: cat parent.tcl
      #!/bin/sh
      #  exec tclsh "$0" ${1+"$@"}
      puts "Tcl patch level: [info patchlevel]"
      proc Handler {f} {
          if {[gets $f line]<0} {
              global ExecDone errorCode
              if {[catch {close $f} res]} {
                  set ExecDone [list 1 $res $errorCode]
              } else {
                  set ExecDone [list 0]
              }
              return
          }
          puts $line
      }
      set f [open [concat | 2>@ stderr child.tcl] r]
      fileevent $f readable [list Handler $f]
      vwait ExecDone
      if {[lindex $ExecDone 0]} {
          puts stderr "ERROR: [lindex $ExecDone 1]"
          puts stderr "CODE: [lindex $ExecDone 2]"
      }
      
      visage:tmp: ./parent.tcl 
      Tcl patch level: 8.0p2
      Msg to stderr
      Msg to stdout
      ERROR: child process exited abnormally
      CODE: CHILDSTATUS 3299 1
      
      sycamore:tmp: ./parent.tcl 
      Tcl patch level: 8.0.3
      Msg to stderr
      Msg to stdout
      
      This inconsistency breaks existing scripts, and seemingly prevents
      a parent process from gathering the exit status of its child when
      they are connected via a pipeline.
      
      Don Porter
      
      
      
      Results from 8.0.5:
      
      op [~/tmp/auto] 140 % ./parent.tcl 
      Tcl patch level: 8.0.5
      Msg to stderr
      Msg to stdout
      ERROR: child process exited abnormally
      CODE: CHILDSTATUS 16122 1
      
      As desired. 
      -- 12/03/1999 hobbs
      
    4. foundin initialized to: "obsolete: 8.0.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:
      can't use  [catch {close $pipe}] to get the exit status of t
      
    11. type initialized to: "Bug"
  2. Ticket change [8ea5da08c8] (rid 120147) by welch on 2000-10-26 08:23:17:

    1. closedate changed to: "2000-10-26T01:23:17"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [3fa1f1c9c3] (rid 121497) by dgp on 2001-04-05 08:20:13:

    1. closedate changed to: "2001-04-05T01:20:13"
    2. closer changed to: "dgp"
    3. subsystem changed to: "27. Channel Types"