ttrace not updated for errorInfo changes

Bug #1821197 reported by Chris Carlin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tclthread (Ubuntu)
New
Undecided
Unassigned

Bug Description

I was given a Tcl program that uses ttrace to coordinate threads. It worked under Tcl8.4 but fails under 8.6 with the error message below.

After some investigation I found that Tcl changed its behavior with regard to the ::errorInfo and ::errorCode globals, no longer setting them at startup, but ttrace assumes them to be set. ttrace needs to be updated to account for this change.

The change is trivial, and I'll link to a patch that fixed the issue, checking for the variable before trying to access it. The only modification needed is a few lines in ttrace.tcl

Here's the URL of the patch:
https://bitbucket.org/naviserver/naviserver/commits/d118a87689afe116ee3e618809a4b34f66a75379

Here's an example of the error:
Error from thread tid0x70eff460
can't read "::errorInfo": no such variable
    while executing
"set ei $::errorInfo"
    (procedure "ttrace::getentry" line 3)
    invoked from within
"ttrace::getentry load $entry"
    (procedure "script::_load" line 4)
    invoked from within
"script::_$maker"
    (procedure "getscript" line 14)
    invoked from within
"getscript"
    (procedure "::ttrace::update" line 10)
    invoked from within
"::ttrace::update"
    (lambda term "{dir} {
    if {[info exists ::env(TCL_THREAD_LIBRARY)] &&
 ..." line 11)
    invoked from within
"::apply {{dir} {
    if {[info exists ::env(TCL_THREAD_LIBRARY)] &&
 [file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} {
 source $::env(TCL_THREA..."
    ("package ifneeded Ttrace 2.8.2" script)
    invoked from within
"package require Ttrace"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.