Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 336d9452b4a02072a46e95131aa4455cebd5204071ff849a43897b62903f264a
Ticket: 79474c58800cdf94559a2c01230b4536aa416016
refchan segfault
User & Date: mjanssen on 2019-07-31 13:22:05
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    The following script causes a segfault in DoRead:
    <verbatim>
    proc nexec {cmd in out stderr} {
        lassign [chan pipe] in1 out1
        lassign [chan pipe] in2 out2
        lassign [chan pipe] in3 out3
        puts [exec {*}$cmd >@ $out2 2>@ $out3 <@ $in1 &] 
        fileevent $in2 readable [list chan copy $in2 $out]
        fileevent $in3 readable [list chan copy $in3 $stderr]
        fileevent $out1 writable [list chan copy $in $out1]
    }
    
    proc test {args} {
      puts $args 
      set rest [lassign $args mode chan]
      switch -exact $mode {
        read {puts $chan "Test" ; close $chan}
        initialize {return "initialize watch finalize read write"}
        finalize {}
      }
    }
    
    set c [chan create "read write" test]
    
    nexec {sh -c "echo test"} $c $c $c
    
    vwait forever
    
    </verbatim>
    
    Gives with a debug build:
    
    <verbatim>
    % source exec-test.tcl
    initialize rc0 {read write}
    36514
    read rc0 4096
    write rc0 {Test
    }
    finalize rc0
    Assertion failed: (bufPtr != NULL), function DoRead, file /Users/mpcjanssen/Src/tcltk/tcl/generic/tclIO.c, line 9815.
    </verbatim>
    
  5. foundin changed to: "8.6.9"
  6. is_private changed to: "0"
  7. login: "mjanssen"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "9e3254e6e3c2643cc148bab2d55f46bb4c0446f4"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "mjanssen"
  14. subsystem changed to: "25. Channel System"
  15. title changed to: "refchan segfault"
  16. type changed to: "Bug"