Overview
| Artifact ID: | 7f8ce56d41d9f25193c84e5ffaa6e8cacd99d875 |
|---|---|
| Ticket: | 32ae34e63a3db0a542a6795594914baa1f231007
[chan copy] reflected channel segfault |
| User & Date: | dgp on 2015-08-11 20:46:57 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
This script segfaults: proc driver {cmd args} { variable buffer variable index set chan [lindex $args 0] switch -- $cmd { initialize { set index($chan) 0 set buffer($chan) [encoding convertto utf-8 \ [string repeat a 100]] return {initialize finalize watch read} } finalize { unset index($chan) buffer($chan) return } watch { if {"read" in [lindex $args 1]} { chan postevent $chan read } return } read { set n [lindex $args 1] set new [expr {$index($chan) + $n}] set result [string range $buffer($chan) $index($chan) $new-1] set index($chan) $new return $result } } } proc noop args {} proc more {c outChan bytes args} { if {[eof $c]} { set ::done eof catch {close $c} return } if {[llength $args]} { set ::done error } else { chan copy $c $outChan -command noop } } set c [chan create read [namespace which driver]] chan configure $c -encoding utf-8 set outChan [open out w] chan configure $outChan -encoding iso8859-1 after 100 {set ::done timeout} chan copy $c $outChan -size 99 -command [list [namespace which more] $c $outChan] vwait ::done puts $::done close $outChan file delete out rename driver {} rename more {} unset ::done - foundin changed to: "all"
- is_private changed to: "0"
- login: "dgp"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "dgp"
- subsystem changed to: "25. Channel System"
- title changed to: "[chan copy] reflected channel segfault"
- type changed to: "Bug"