Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: cd5788d4bdfd86b948bc955019d27936959afa14
Ticket: 730244ffffffffffffffffffffffffffffffffff
missing refCount management in Tcl_EvalObjv
User & Date: dkf on 2003-05-13 04:41:03
Changes

  1. icomment:
    Logged In: YES 
    user_id=79902
    
    Looks like a bug in alias handling to me.The problem is that
    the deleting of the alias makes the refcounts on the
    (leading) arguments decrease at an unexpected time,
    resulting in the refcounts for the command obj dropping to
    zero before the return of Tcl_EvalObjv (so violating the
    general contractural principle of Tcl_Eval* functions.)
    Traces are the most obvious way of triggering this, yes, but
    I'd hate to swear that that's the only way it could happen.
    Two ways to fix this:
        1) incr the refcounts of the prefix part of the alias
    command for the duration of the alias call
        2) decouple the Alias structure from the alias command
    lifespan, and use refcounting to delete *that* only when the
    last reference to it (whether from the command or from the
    executing instances) goes away.
    
    I prefer the second way, but the first would do too.  I
    don't think either will be too expensive in practice.
    
    
  2. login: "dkf"
  3. mimetype: "text/plain"
  4. username: "dkf"