Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 999ef7f32e33ee682d52576490540f6a30b1e1ab
Ticket: 875395ffffffffffffffffffffffffffffffffff
modifying shared object panic in tclIndexObj.c
User & Date: vincentdarley on 2004-01-12 14:24:29
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    In 8.4.5/8.5a0 Tcl_GetIndexFromObj calls
    Tcl_GetIndexFromObjStruct which may do this:
    
    resultPtr = Tcl_GetObjResult(interp);
    Tcl_AppendStringsToObj(resultPtr,
    (numAbbrev > 1) ? "ambiguous " : "bad ", msg, " \"",
    key, "\": must be ", STRING_AT(tablePtr,offset,0),
    (char*)NULL);
    
    since Tcl_GetIndexFromObj can be called from arbitrary
    C code, there can be no assumption the interp result is
    empty/unshared, and the above code can crash (in fact
    it does crash when I use alphatk+tkdnd together).
    
    One fix is to insert:
    
    if (Tcl_IsShared(resultPtr)) {
        Tcl_Obj *copy = Tcl_DuplicateObj(resultPtr);
        Tcl_DecrRefCount(resultPtr);
        Tcl_SetObjResult(interp, copy);
        resultPtr = copy;
    }
    
    but I leave the correct fix to the maintainers.
    
    
  4. foundin changed to: "obsolete: 8.4.5"
  5. priority changed to: "7 High"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "vincentdarley"
  9. subsystem changed to: "13. Index Object"
  10. title changed to: "modifying shared object panic in tclIndexObj.c"
  11. type changed to: "Bug"