[Starkit] Threads and wish on Windows: "called Tcl_Close on channel
with refCount > 0"
Eckhard Lehmann
ecky-l at web.de
Wed Apr 12 10:38:39 CEST 2006
Hi,
I have encountered a bug when using vfs::mk4 filesystems and multi threaded wish on Windows. When mounting a non-existent starkit and using [file copy] to copy a file from the filesystem into the kit, wish crashes with the error message "called Tcl_Close on channel with refCount > 0". I am not sure whether this is a wish problem or a vfs, or metakit problem, so I 've reported this issue in the Tk bug tracker:
http://sourceforge.net/tracker/index.php?func=detail&aid=1468291&group_id=12997&atid=112997
What do you think about this?
Eckhard
-----
Here is a copy of the bug report, without comments
When using vfs::mk4 and [file copy] and multi threading
on Windows, wish crashes with the error message:
"called Tcl_Close on channel with refCount > 0"
This issue applies only to the wish application or
tclkit on windows. Tclsh and tclkitsh on windows are
not affected. When using [file copy] on normal non-vfs
directories, everything is fine as well. Only with
*non-existing* vfs directories mounted via
vfs::mk4::Mount (or maybe other vfs::*::Mount's) the
crash appeared to me.
I've written a short script which makes it easy to
reproduce the bug:
# channel refcount bug
package require Thread
catch {console show}
set T [thread::create -preserved]
thread::send $T [list set D [file dirname [info script]]]
set script {
package require vfs::mk4
set logOpen 0
proc ::Log {msg} {
if {$::logOpen} {
set mode a
} else {
set mode w
set ::logOpen 1
}
set L [open [file join $::D log.txt] $mode]
puts $L $msg
close $L
}
Log $D
set src [file join $D test.txt]
set tdir [file join $D tdir.kit]
set dest [file join $tdir test.txt]
Log $dest
Log 1
set vfsh [vfs::mk4::Mount $tdir $tdir]
Log 2
file copy $src $dest
Log 3
vfs::mk4::Unmount $vfsh $tdir
Log 4
}
thread::send -async $T $script
# end channel bug script
When the directory exists, the crash does not happen,
but the script runs only until "Log 2".
It is not very clear to me whether this is a bug in Tk
(because it only appears with wish/windows) or vfs or
metakit.
_______________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
More information about the Starkit
mailing list