Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2000-10-26
08:20 • Closed ticket [218364ffff]: write traces on ::errorInfo screw up the traceback m... artifact: 31ccb497cf user: welch
00:56 • New ticket [218364ffff]. artifact: 217d3c11ad user: nobody

write traces on ::errorInfo screw up the traceback mechanism

Closed / Fixed218364ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:56:44
OriginalBugID: 4189 Bug
Version: 8.3
SubmitDate: '2000-02-16'
LastModified: '2000-04-03'
Severity: LOW
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: All
FixedDate: '2000-10-25'
ClosedDate: '2000-04-03'


Name:
Alexandre Ferrieux

Comments:
I discovered that while trying to implement a 'substituted trace'
    utility (as described earlier in an RFE).
    To do that in pure Tcl, I'd use [info level 0] from within a write trace
    on ::errorInfo. This way I'd get the actual parameters of all the calls
    on the stack trace instead of the stupid unsubstituted source exceprt
    (try debugging a recursive proc with that...).

    Except today I can't due to the bug just reported.

ReproducibleScript:
trace variable ::errorInfo w tt
proc tt args {#donothing}

# from now on , when an error bursts the ::errorInfo contains only the outermost 'while executing'
proc a {} b
proc b {} c
proc c {} d
proc d {} e
a
invalid command name "e"
puts $::errorInfo
invalid command name "e"
    while executing
"a"

DesiredBehavior:
A write trace doing nothing should be transparent !!!



Without the trace this is:

invalid command name "e"
    while executing
"e"
    (procedure "d" line 1)
    invoked from within
"d"
    (procedure "c" line 1)
    invoked from within
"c"
    (procedure "b" line 1)
    invoked from within
"b"
    (procedure "a" line 1)
    invoked from within
"a"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 a"

The problem is that the errorInfo trace would get repeatedly
called at each level.  Traces disable writing to the var in
this case for safety (defined behavior). 
-- 04/03/2000 hobbs
welch Closed ticket [218364ffff]. [History diff]2000-10-26 08:20:09
Log in (anonymous is fine) to add a comment.