Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6e2904f08df6443ceb8d251268535cc238dc6114
Ticket: 218621ffffffffffffffffffffffffffffffffff
Doc/implementation mismatch for AssocData
User & Date: nobody on 2000-10-26 01:03:15
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 1486 Bug
    Version: 8.0.5
    SubmitDate: '1999-03-11'
    LastModified: '1999-04-09'
    Severity: MED
    Status: Released
    Submitter: pat
    ChangedBy: surles
    OS: Linux-Red Hat
    OSVersion: 5.1
    Machine: Other
    FixedDate: '1999-04-09'
    FixedInVersion: 8.1b3
    ClosedDate: '2000-10-25'
    
    
    Name:
    Bart Veer
    
    Extensions:
    None
    
    CustomShell:
    None.
    
    ReproducibleScript:
        The man page for Tcl_DeleteAssocData() states:
        
        "Tcl_DeleteAssocData deletes an association with a specified key in
        the given interpreter.  It does not call the deletion procedure."
        
        The implementation in generic/tclBasic.c contains:
        
            dPtr = (AssocData *) Tcl_GetHashValue(hPtr);
            if (dPtr->proc != NULL) {
                (dPtr->proc) (dPtr->clientData, interp);
            }
        
        
    
    
    
    ObservedBehavior:
        Application code that invoked Tcl_DeleteAssocData() also deleted the
        clientdata, as per the documentation. This resulted in a double-free
        attempt and heap corruption.
        
    
    
    
    DesiredBehavior:
        Tcl_DeleteAssocData() probably should delete the clientdata, for
        consistency with e.g. Tcl_DeleteCommand(). Therefore the code is
        correct, but the relevant line from the documentation needs to be
        removed. Obviously this approach has the advantage of not changing the
        behaviour of any existing code.
        
    
    
    
    
    
        This problem is also present in Tcl8.1b1
    ---
    04/09/1999 13:32 - surles - Changed the man page to say it DOES call the deletion proc.
    
    
    
  4. foundin changed to: "final: 8.0.5"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "46. Traces"
  10. title changed to: "Doc/implementation mismatch for AssocData"
  11. type changed to: "Bug"