Skip to content
Tcl Source Code View Ticket
Login

View Ticket

String rep freed before internal rep

Closed / Fixed218676ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:04:01
OriginalBugID: 1710 Bug
Version: 8.0.5
SubmitDate: '1999-04-05'
LastModified: '1999-09-20'
Severity: CRIT
Status: Released
Submitter: pat
ChangedBy: hobbs
OS: All
OSVersion: NA
Machine: NA
FixedDate: '1999-09-20'
FixedInVersion: 8.2
ClosedDate: '2000-10-25'


Name:  Paul Duffin
email:  [email protected]
Support:  None
Severity:  1
Synopsis:  String rep freed before internal rep.

ObservedBehavior:
    When for whatever reason both the internal representation and the string
    representation of an object are freed, e.g. inside Tcl_SetStringObj, or
    Tcl_SetListObj, or when an object itself is freed, the string rep is
    being freed
    before the internal rep. This breaks my code because I try and access
    the string
    representation in the freeIntRepProc.
    
    The core is inconsistent, sometimes it frees the string rep first, other
    times 
    it frees it last, and the behaviour has changed from 8.0.4 to 8.1b2,
    although it
    affects all 8.* releases.
    

DesiredBehavior:
    I expect the string representation to be freed after the internal
    representation
    so that I can use it in my freeIntRepProc. This affects all 8.* releases
    so 
    should be fixed in Tcl8.1b2 and Tcl8.0.5.


This is not documented behavior, but it's an easy fix so we might as well make it.  I can't see any reason why the internal rep should not be freed before the string rep in all cases, so we may want to document this as the expected sequence, and possibly add a new interface to encapsulate this.  
04/27/1999 10:00 - stanton -
This fix has been applied sometime before 8.2.0 (internal free rep
proc is called before InvalidateStringRep). 
-- 09/20/1999 hobbs
welch Closed ticket [218676ffff]. [History diff]2000-10-26 08:27:10
dgp Open ticket [218676ffff]. [History diff]2001-04-21 03:23:19
dgp Closed ticket [218676ffff]. [History diff]2001-04-21 03:23:41
Log in (anonymous is fine) to add a comment.