Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 26d8426fa5b1ed164f2915974d0f260f23a13a99aa0c8da5cdc8bc5ca54410fc
Ticket: bd94500678e837d7ed50cf6d5000df8f38cd5e39
SEGFAULT by conversion of unicode (out of BMP) to byte-array.
User & Date: sebres on 2019-02-05 22:36:31
Changes

  1. icomment:
    Well this may be never ending story, Jan.
    
    [/artifact?udc=1&name=f38fd5f3de77efc4&ln=370-371|This] is called "bomb planting" between developers, and such things are really ticking bombs, because could cause endless cycle if one does not take care - like now in my fix - [42976af3f3035391]. There is sooooo many places in Tcl (and some Tcl-modules) where "uni-ch" is modified after call of UtfToUniChar (so in case of high surrogate it may never enter next step and do low surrogate, so will enter endless cycle).
    
    Anyway I don't think that a public function should return 0, where it has previously never do that (it returned always a result >= 1), still worse it is dependend from value of output parameter now (so as result of previous execution).
    
    Just think about some wrapping things like toupper/tolower handler's (they seem to be safe in Tcl, but what is about some modules doiong similar things and modifying "ch" in-between)?
    
    So I'd not close this ticket, until we've verified all calls of TclUtfToUniChar/Tcl_UtfToUniChar in whole world of Tcl (and in Tcl self).
    
  2. login: "sebres"
  3. mimetype: "text/x-fossil-wiki"
  4. resolution changed to: "Fixed"
  5. status changed to: "Pending"