Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 05ba2431eaa0496d783b6a2de5164d23b86cf8941fe887db416f90f779c6f83b
Ticket: db4f2843cdb28c27fddf511567bc9287484852ae
Sporadic segfault (BO) using tclIO
User & Date: sebres on 2023-12-05 23:11:11
Changes

  1. icomment:
    Fixed in [cc90065303e11f36].<br/>
    The reason for this tricky bug is that [/file?ci=cc90065303e11f36&name=generic/tclStringObj.c&ln=1279-1283|Tcl_AppendToObj] always prefers unicode representation to utf-8 if object has unicode (in opposite to [/file?ci=cc90065303e11f36&name=generic/tclStringObj.c&ln=959|Tcl_SetObjLength] which always prefer utf-8 if it is there), and so <code>Tcl_AppendToObj</code> would rather enlarge the unicode representation of object (basically reserve place for unicode data) if it shimmers to real unicode somewhere by processing outside, however the <code>ReadChars</code> (that itself always works with utf-8 due to external to utf-8 conversions by encoding etc) expects that the buffer of utf-8 gets enlarged instead, what doesn't happen by backwards utf-8 regeneration in followed [/artifact?name=8e47d1977522188d&ln=6119-6122|TclGetString].<br/>
    It would only work with <code>Tcl_AppendToObj</code> if we working on completely new or empty object (e. g. <code>appendFlag = 0</code> which would clear it and so tries to reuse the buffer) or it got duplicated (if shared) previously, and duplication prefers utf-8 representation, etc.<br/>
    It was really rare, because really tricky, since it expects certain constellation (like <code>appendFlag = 1</code> and "shimmering" to real unicode) to get reproduced. Anyway fixed now, waiting for CI.
    
  2. login: "sebres"
  3. mimetype: "text/x-fossil-wiki"
  4. resolution changed to: "Fixed"
  5. status changed to: "Pending"