Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2af3ced5a9b0261086ca5d41b164031859b9b33b19a56fe4a13a8f94136af159
Ticket: da63e4c1efcfc3e68fdc4527df6a8109e1eac348
Crash in Tcl_WriteChars()
User & Date: anonymous on 2022-11-23 09:38:36
Changes

  1. icomment:
    The problem seems to be, that after
    
        objPtr = Tcl_NewStringObj(src, len);
        copy = TclNarrowToBytes(objPtr);
    
    objPtr and copy point to the same Tcl_Obj, and
    that after the TclDecrRefCount in
    
        src = (char *) Tcl_GetByteArrayFromObj(copy, &len);
        TclDecrRefCount(objPtr);
    
    also the object pointed to by copy is cleared, such that
    the final 
    
        TclDecrRefCount(copy);
    
    causes the crash. So, it looks to me, that either adding 
    one Tcl_IncrRefCount() or removing one of the TclDecrRefCount()
    solves the issue. TclNarrowToBytes() seems to return always
    the same object, or removing the first TclDecrRefCount(objPtr) seems
    ok.
    
  2. login: "anonymous"
  3. mimetype: "text/plain"