Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 300468b50c80f87539b0c8febab0c31f0c674dcf
Ticket: 2803109fffffffffffffffffffffffffffffffff
tsv - string rep - core dump
User & Date: dgp on 2009-06-10 01:17:45
Changes

  1. icomment:
    
    some more details on what was wrong, and
    how the patch deals with it...
    
    The "string" Tcl_ObjType failed to always
    handle the case of a "pure unicode" empty
    string.  In UpdateStringOfString() it failed
    to create a string rep, leading to the panic
    reported here.  In AppendUtfToUtf() it 
    leaped right into appending without checking
    that it had something in place to append to.
    
    Elsewhere in the implementation of the
    "string" Tcl_ObjType, these deficiencies
    were dealt with by trying to prevent the
    creation of "pure unicode" empty string
    values.  Everywhere such a value would
    normally be created, the usual empty
    string rep was added so that the value was
    no longer a "pure unicode" value.
    
    The problem with that approach is that
    the routine Tcl_InvalidateStringRep() is
    public, and so long as the stork model
    is respected, extensions are supposed to
    be free to create "pure intrep" values.
    That's what the Thread package was
    doing.
    
    What the patch does is first to fix up those
    parts of the "string" ObjType implementation
    that could not handle a "pure unicode" empty
    string value.  Then, since that value is no
    longer troublesome, other parts of the implementation
    that tried to prevent the creation of such a value
    have been removed.  So now the kind of 
    value that triggered the panic is much more
    routinely created with Tcl itself, with no need
    for an extension to do it.  This means that
    existing tests in the test suite already cover
    the new code when the patch is applied.
    
    
    
  2. login: "dgp"
  3. mimetype: "text/plain"
  4. username: "dgp"