Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2024-05-23
11:35 • Closed ticket [3610393fff]: forwards clash with execution traces plus 6 othe... artifact: 98c53bf181 user: dkf
2019-12-20
16:17 • Ticket [3610400fff] tailcall clashes with execution traces status still Open... artifact: 14b6a9a826 user: dkf
2018-07-12
14:09 • Ticket [3610400fff]: 3 changes artifact: 568db85484 user: pooryorick
12:52 • Ticket [3610400fff]: 3 changes artifact: 4e43469bda user: pooryorick
2018-04-06
16:37 • Ticket [3610400fff]: 3 changes artifact: 01935a50fe user: dgp
2014-09-14
18:16 • Ticket [3610400fff]: 6 changes artifact: 8532330a20 user: dgp
2013-04-09
18:05 • New ticket [3610400fff]. artifact: 20e9379f13 user: dgp

tailcall clashes with execution traces

Open3610400fffffffffffffffffffffffffffffffffCreated 14 years agoUpdated 7 years ago
Descriptionplain2013-04-09 18:05:52
working on 3610393, I constructed this script to
see how ensemble redirections play with execution
traces, and found an issue with [tailcall]:

namespace eval foo {
    namespace export *
    proc target {} {puts Hit!}
    proc bar {} {tailcall target}
    namespace ensemble create
}
proc harness {} {
    foo target
    foo bar
}
proc handle {cmd args} {
    puts "Command [lindex $cmd 0] resolves to:"
    puts "\t'[uplevel 1 [list ::namespace which -command [lindex $cmd 0]]]'"
    puts "\t\tResolved at level [uplevel 1 {info level}]"
}
trace add execution harness enterstep handle
harness


Output:

Command foo resolves to:
        '::foo'
                Resolved at level 1
Command ::foo::target resolves to:
        '::foo::target'
                Resolved at level 1
Command puts resolves to:
        '::puts'
                Resolved at level 2
Hit!
Command foo resolves to:
        '::foo'
                Resolved at level 1
Command ::foo::bar resolves to:
        '::foo::bar'
                Resolved at level 1
Command tailcall resolves to:
        '::tailcall'
                Resolved at level 2
Command target resolves to:
        ''
                Resolved at level 1
Command puts resolves to:
        '::puts'
                Resolved at level 2
Hit!

The commonality with oo forwards is that
tailcall also causes command name resolution
to be done early, in a context that may/does not
appear in a stack frame at the time the command
execution (and its execution traces) fire.
dgpplain2014-09-14 18:16:43
ping
dgpplain2018-04-06 16:37:05
ping
pooryorick Ticket [3610400fff]: 3 changes [History diff]2018-07-12 12:52:13
pooryorick Ticket [3610400fff]: 3 changes [History diff]2018-07-12 14:09:44
dkfhtml2019-12-20 16:17:28

I have no idea what to do with this.

Log in (anonymous is fine) to add a comment.