Skip to content
Tcl Source Code History Of Ticket 1004065
Login

History Of Ticket 1004065

Artifacts Associated With Ticket 1004065

  1. Ticket change [74f77ff322] (rid 105308) by loewis on 2004-08-05 16:51:32:

    1. assignee initialized to: "nijtmans"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      I built Tcl 8.4.7 by setting TCL_UTF_MAX to 6 in tcl.h
      (changed from 3). I then run the command
      
      set x [encoding convertfrom utf-8 \xf0\x9d\x99\xaf]
      
      Tcl crashes with the traceback
      
      #0  0x080994e7 in TableFromUtfProc (clientData=0x810acb0,
          src=0x8115960 "ð\235\231¯ð\213\030@# Default system
      startup file for Tcl-based applications.  Defines\n#
      \"unknown\" procedure and auto-load facilities.\n#\n#
      RCS: @(#) $Id: init.tcl,v 1.55.2.3 2004/05/03 14:28:59
      dgp Exp $\n#\n# Copy"..., srcLen=4, flags=0,
      statePtr=0x8114b04, dst=0x8116988 "% ", dstLen=4111,
      srcReadPtr=0xbffff068,
          dstWrotePtr=0xbffff074, dstCharsPtr=0xbfffefe0) at
      ../generic/tclEncoding.c:2353
      #1  0x08097a22 in Tcl_UtfToExternal (interp=0x0,
      encoding=0x810adc0,
          src=0x8115960 "ð\235\231¯ð\213\030@# Default system
      startup file for Tcl-based applications.  Defines\n#
      \"unknown\" procedure and auto-load facilities.\n#\n#
      RCS: @(#) $Id: init.tcl,v 1.55.2.3 2004/05/03 14:28:59
      dgp Exp $\n#\n# Copy"..., srcLen=4, flags=0,
      statePtr=0x8114b04, dst=0x8116988 "% ", dstLen=4111,
      srcReadPtr=0xbffff068,
          dstWrotePtr=0xbffff074, dstCharsPtr=0xbfffefe0) at
      ../generic/tclEncoding.c:1091
      #2  0x080b2848 in WriteChars (chanPtr=0x8115940,
      src=0x811a59c "", srcLen=0) at ../generic/tclIO.c:3170
      #3  0x080b24b7 in Tcl_WriteObj (chan=0x8115940,
      objPtr=0x81140e8) at ../generic/tclIO.c:2960
      #4  0x08055128 in Tcl_Main (argc=1, argv=0xbffff2f4,
      appInitProc=0x80549e6 <Tcl_AppInit>)
          at ../generic/tclMain.c:407
      #5  0x080549dc in main (argc=1, argv=0xbffff2f4) at
      ../unix/tclAppInit.c:90
      
      This is all on a Debian system.
      
    4. foundin initialized to: "obsolete: 8.4.7"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "loewis"
    9. subsystem initialized to: "44. UTF-8 Strings"
    10. title initialized to: "UTF-8 encoding crashes in UCS-4 mode"
    11. type initialized to: "Bug"
  2. Ticket change [1a09c6469a] (rid 122906) by dgp on 2004-08-06 00:23:14:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      A crash is definitely a bug; thanks for the report.
      
      That said, your snippet of code is likely
      not doing what you intend.  Each \xHH
      substitution produces one Unicode character,
      not one byte.
      
      As a general rule \xHH substitution should be
      avoided in Tcl scripts.  Use \u instead.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  3. Ticket change [8c36a8c29d] (rid 127713) by loewis on 2004-08-06 00:50:21:

    1. icomment:
      Logged In: YES 
      user_id=21627
      
      I believe it does what I want to do: explicitly invoke
      decoding of an UTF-8 encoded string. I hope that the string
      I specify contains four characters, which is then
      interpreted as an octet string of four octets when passed to
      "encoding convertfrom". This, in turn, should generate a
      string with a single character.
      
      Using the \u form is not possible, since it only supports
      characters with numeric values up to U+FFFF. However, the
      character above is U+0001D6FF, MATHEMATICAL SANS-SERIF BOLD
      ITALIC SMALL Z. Other languages support a \U notation for
      non-BMP characters. Apparently, Tcl doesn't (which is not
      really a problem if you could get the character by decoding
      it from UTF-8).
      
      
    2. login: "loewis"
    3. mimetype: "text/plain"
    4. username: "loewis"
  4. Ticket change [1571203925] (rid 124566) by dgp on 2004-08-06 01:25:23:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      sorry, I misspoke before.
      I got my "convertfrom" and
      "convertto" mixed up.
      Your demo script is fine.
      
      The following demo script
      should be equivalent:
      
      set x [encoding convertfrom utf-8 \u00f0\u009d\u0099\u00af]
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [2a9615620d] (rid 118605) by dgp on 2004-08-06 01:34:46:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Confirmed on the HEAD.
      
      Note this bug only shows up 
      in an interactive tclsh.  The problem
      happens when converting to
      the system encoding for writing
      the result to stdout.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  6. Ticket change [26a686b6b9] (rid 88387) by dgp on 2004-08-06 01:51:16:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      It looks like the encoding routines
      simply do not support the
      
      #define TCL_UTF_MAX 6
      
      variant currently.
      
      The attached patch stops the
      reported crash, but a more thorough
      review is in order to really address
      the issue.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  7. Add attachment "1004065.patch" [2c07ae96a7] (rid 118837) by dgp on 2004-08-06 01:51:17.

  8. Ticket change [1518adb469] (rid 124507) by dgp on 2004-08-06 01:51:17:

    1. icomment:
      
      
      File Added - 96520: 1004065.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  9. Ticket change [949c3a92aa] (rid 106023) by dkf on 2004-08-06 14:47:38:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      The question is really how should we support unicode chars
      outside the BMP?
      
      (I suspect the answer involves surrogates internally, and
      goodness knows what externally.)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  10. Ticket change [7bd79b5497] (rid 96974) by loewis on 2004-08-06 15:50:59:

    1. icomment:
      Logged In: YES 
      user_id=21627
      
      For the case of TCL_UTF_MAX==6 (which I refer to in this
      report), there is no need for surrogates: They can be
      represented just using a four-byte integer.
      For the two-byte Unicode case, you have two options:
      - use surrogates, or
      - explicitly don't support surrogates, and non-BMP characters
      
      In the latter alternative, you essentially would tell people
      that they need a four-byte Unicode installation if they want
      non-BMP characters.
      
      Of course, there will be additional issues externally, e.g.
      when trying to pass non-BMP characters to the GUI platform
      in Tk, when finding appropriate fonts, etc.
      
      
    2. login: "loewis"
    3. mimetype: "text/plain"
    4. username: "loewis"
  11. Ticket change [f7d2ceffb3] (rid 91436) by hobbs on 2004-11-13 06:44:20:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=72656
      
      I've applied the patch to avoid the crash for 8.4.8 and
      8.5a2, but a full evaluation of the TCL_UTF_MAX==6 is still
      required.
      
      
    3. login: "hobbs"
    4. mimetype: "text/plain"
    5. resolution changed to: "Fixed"
    6. username: "hobbs"
  12. Ticket change [6f396b2a50] (rid 100280) by dgp on 2004-11-16 05:50:54:

    1. assignee changed to: "hobbs"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      the command in this report
      no longer crashes in 8.4.8
      with TCL_UTF_MAX==6.
      The test suite also runs to
      completion with only tests
      encoding-16.1 and utf-2.8 
      failing, which
      appears should be expected.
      
      likewise for the HEAD.
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. username: "dgp"
  13. Ticket change [1036fbd00a] (rid 182195) by dgp on 2020-04-21 15:49:16:

    1. assignee changed to: "dgp"
    2. closer changed to: "nobody"
    3. comment changed to:
      I built Tcl 8.4.7 by setting TCL_UTF_MAX to 6 in tcl.h
      (changed from 3). I then run the command
      
      set x [encoding convertfrom utf-8 \xf0\x9d\x99\xaf]
      
      Tcl crashes with the traceback
      
      #0  0x080994e7 in TableFromUtfProc (clientData=0x810acb0,
          src=0x8115960 "ð\235\231¯ð\213\030@# Default system
      startup file for Tcl-based applications.  Defines\n#
      \"unknown\" procedure and auto-load facilities.\n#\n#
      RCS: @(#) $Id: init.tcl,v 1.55.2.3 2004/05/03 14:28:59
      dgp Exp $\n#\n# Copy"..., srcLen=4, flags=0,
      statePtr=0x8114b04, dst=0x8116988 "% ", dstLen=4111,
      srcReadPtr=0xbffff068,
          dstWrotePtr=0xbffff074, dstCharsPtr=0xbfffefe0) at
      ../generic/tclEncoding.c:2353
      #1  0x08097a22 in Tcl_UtfToExternal (interp=0x0,
      encoding=0x810adc0,
          src=0x8115960 "ð\235\231¯ð\213\030@# Default system
      startup file for Tcl-based applications.  Defines\n#
      \"unknown\" procedure and auto-load facilities.\n#\n#
      RCS: @(#) $Id: init.tcl,v 1.55.2.3 2004/05/03 14:28:59
      dgp Exp $\n#\n# Copy"..., srcLen=4, flags=0,
      statePtr=0x8114b04, dst=0x8116988 "% ", dstLen=4111,
      srcReadPtr=0xbffff068,
          dstWrotePtr=0xbffff074, dstCharsPtr=0xbfffefe0) at
      ../generic/tclEncoding.c:1091
      #2  0x080b2848 in WriteChars (chanPtr=0x8115940,
      src=0x811a59c "", srcLen=0) at ../generic/tclIO.c:3170
      #3  0x080b24b7 in Tcl_WriteObj (chan=0x8115940,
      objPtr=0x81140e8) at ../generic/tclIO.c:2960
      #4  0x08055128 in Tcl_Main (argc=1, argv=0xbffff2f4,
      appInitProc=0x80549e6 <Tcl_AppInit>)
          at ../generic/tclMain.c:407
      #5  0x080549dc in main (argc=1, argv=0xbffff2f4) at
      ../unix/tclAppInit.c:90
      
      This is all on a Debian system.
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. priority changed to: "7 High"
    7. severity changed to: "Minor"
  14. Ticket change [f1d46e9007] (rid 182314) by jan.nijtmans on 2020-04-23 12:15:15:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2458963.01059837"
    3. closer changed to: "jan.nijtmans"
    4. icomment: "Fixed in [ed551cd16cc8a97e]"
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. status changed to: "Closed"
  15. Ticket change [fdf6e2bafd] (rid 182341) by dgp on 2020-04-23 16:16:23:

    1. closedate changed to: "2458963.17805056"
    2. closer changed to: "dgp"
    3. icomment:
      
      After the fix, I still see the lines
      
      https://core.tcl-lang.org/tcl/artifact/da1c0f1647cd7d2c?ln=2687-2696
      
      If the bug is fixed, we should be able to remove them.
      
      Also, maybe there should be a test case revealing they are still there when they should not be?
      
    4. login: "dgp"
    5. mimetype: "text/plain"
  16. Ticket change [725aa687ca] (rid 182344) by dgp on 2020-04-23 16:19:08:

    1. closedate changed to: "2458963.17996052"
    2. icomment:
      These lines may also need attention.
      
      https://core.tcl-lang.org/tcl/artifact/da1c0f1647cd7d2c?ln=2474-2478
      
    3. login: "dgp"
    4. mimetype: "text/plain"