Ticket #61 (closed defect: wontfix)
Threads with eggdrop
| Reported by: | Ofloo | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.6.20 |
| Component: | Core | Version: | 1.6.20 |
| Keywords: | Cc: |
Description
tcl version 8.5 threads
[14:21:15] #Ofloo# set errorInfo
Currently: couldn't save command result in variable
Currently: while executing
Currently: "catch {package require Thread} version"
Currently: (in namespace eval "::ttrace" script line 9)
Currently: invoked from within
Currently: "namespace eval ttrace {
Currently:
Currently: # Setup some compatibility wrappers
Currently: if {[info commands nsv_set] != ""} {
Currently: variable tvers 0
Currently: variable mu..."
Currently: (file "/usr/local/lib/thread2.6.5/ttrace.tcl" line 47)
Currently: invoked from within
Currently: "source [file join $dir ttrace.tcl]"
Currently: (procedure "thread_source" line 8)
Currently: invoked from within
Currently: "thread_source /usr/local/lib/thread2.6.5"
Currently: ("package ifneeded Ttrace 2.6.5" script)
Currently: invoked from within
Currently: "package require Ttrace"
.tcl catch {package require Thread} version
Tcl error: couldn't save command result in variable
.tcl catch
Tcl error: wrong # args: should be "catch script ?resultVarName? ?optionVarName?"
.tcl catch {package require Thread} vers
Tcl: 0
.set version
[14:25:16] #Ofloo# set version
Currently: 1.6.20+RC2 1062003 PRE-RELEASE 1279200246 RC2
the problem is that when you package require Ttrace which is part of threads it tries to overwrite the version variable, .. if this is loaded from a script the bot will crash and core
the exact problem is the variable name, both Ttrace and eggdrop are makeing use of this variable.
Change History
comment:2 Changed 3 years ago by thommey
- Status changed from new to closed
- Resolution set to wontfix
This is indeed caused by Tcl's Thread package (lib/ttrace.tcl) using the global variable $version as a temporary variable. That's surely a bug on their side, because they do not need a variable that is this likely to be used just as a temporary one. I filed a bug at Tcl's sourceforge bugtracker with that: here.
We cannot change our version variable to be writable or rename it because existing Tcl scripts rely on it and it makes perfect sense to accompany a global $version variable (other applications do that too - aMSN for example).
So the only fix is for you to modify lib/ttrace.tcl to use another variable name there.
comment:3 Changed 3 years ago by Ofloo
ok add "variable version" right after "namespace eval ttrace {" that should take care of it, without having to change any of the code.
comment:5 Changed 3 years ago by Ofloo
here's a patch if you could be so kind to post it to ttrace on sf
Code:
--- ttrace.tcl 2010-07-25 01:46:47.000000000 +0200
+++ ttrace.tcl 2010-07-25 01:43:53.000000000 +0200
@@ -46,6 +46,7 @@
namespace eval ttrace {
+ variable version
# Setup some compatibility wrappers
if {[info commands nsv_set] != ""} {
variable tvers 0

file tcl.c
static tcl_strings def_tcl_strings[] = {
#ifndef STATIC
#endif
};
changed
into
and it works, however then the variable version doesn't exist anymore, but it is changed into versions instead.
weird that it works in the same namespace/scope