Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8fade80a5b0684f0e2c5668da59cd9f10b6c8e5b
Ticket: 404865ffffffffffffffffffffffffffffffffff
rare bug in InfoLevelCmd
User & Date: msofer on 2001-02-28 13:22:37
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    (I could *not* trigger this rare event, but I'm sure
    from the code that the bug is there)
    InfoLevelCmd uses "iPtr->varFramePtr->objv" - as far as
    I can tell, it is the only user.
    Now "iPtr->varFramePtr->objv" is a pointer into the
    evaluation stack: it is set in TclObjInterpProc
    (tclProc.c), which gets it from TclExecuteByteCode
    (tclExecute.c) [see INST_INVOKE]
    The trouble is that the evaluation stack may grow (and
    move), so that some combination of events will leave
    iPtr->varFramePtr->objv pointing to ckfreed memory.
    The combination of events could be:
     - proc A invokes proc B; proc B grows the stack
     - after returning from B, proc a requests "info level"
    
    I do not see yet any nice & simple solution. Among the
    clumsy and/or complicated solutions:
     - store instead a stack offset into the CallFrame; let
    InfoLevelCmd know about the execution stack (to my
    eyes, a very bad thing)
      - do not free the old stack memory until execution is
    back at level 0, thereby keeping the pointers valid
    
    Remark also that fixing matters in the first manner
    will work for bytecodes, but may break "info level" for
    non-compiled scripts! The second one may be very costly
    in memory.
    
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "msofer"
  9. subsystem changed to: "17. Commands I-L"
  10. title changed to: "rare bug in InfoLevelCmd"
  11. type changed to: "Bug"