Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 47267eaedd75cd5e7ff7ec474f96e812c119154d
Ticket: 1482718fffffffffffffffffffffffffffffffff
crash after removing trace in recursive call
User & Date: dgp on 2006-05-09 11:21:42
Changes

  1. icomment:
    Logged In: YES 
    user_id=80530
    
    
    I added a test that the two
    numCompiledLocals values were
    the same, and a Tcl_Panic()
    when they are not.  This
    let me detect the problem directly
    without needing lots of other
    things "just so" to force a
    segfault.
    
    This let me simplify the demo
    script to:
    
    load libtrace.so
    proc Console:Eval {cmd} {
        set enterx 0
        set ret [uplevel #0 $cmd]
        if {$enterx} {}
        return $ret
    }
    Console:Eval {
        closeTrace
        Console:Eval {}
    }
    
    The value mismatch
    happens because [closeTrace]
    calls Tcl_DeleteTrace()
    which advances the bytecode
    compile epoch (line 5208
    of tclBasic.c).
    
    This means the nested
    [Console:Eval] call is
    a different compile from
    the outer one, and the two
    compiles are done under
    different settings of the
    DONT_COMPILE_CMDS_INLINE
    flag.  The different compile
    rules may well explain the
    different number of compiledLocals.
    
    The remaining bug here appears
    to be that the CallFrame of
    the outer call now has a procPtr
    field pointing to a Proc corresponding
    to the re-compile?
    
    Either that should not happen, or
    if it's ok for that to happen, then
    the TclLookupSimpleVar needs a rewrite
    to not assume the CallFrame and Proc
    agree about their compiledLocals lists.
    
    
  2. login: "dgp"
  3. mimetype: "text/plain"
  4. username: "dgp"