Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 20e9379f133a6d2b8429c30c1460b9bff6c1c615
Ticket: 3610400fffffffffffffffffffffffffffffffff
tailcall clashes with execution traces
User & Date: dgp on 2013-04-09 18:05:52
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    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.
    
  4. foundin changed to: "current: 8.6.0"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "dgp"
  10. subsystem changed to: "60. NRE and coroutines"
  11. title changed to: "tailcall clashes with execution traces"
  12. type changed to: "Bug"