Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2022-02-07
22:22 • Closed ticket [1fe745559a]: 8.7, 9.0: Conditional jump or move depends on uninit... artifact: b16224b9fe user: jan.nijtmans
22:16
Fix [1fe745559a]: Conditional jump or move depends on uninitialised value in Tcl_UniCharToUtf check-in: 173c09dcf8 user: jan.nijtmans tags: core-8-branch
21:20 • Ticket [1fe745559a] 8.7, 9.0: Conditional jump or move depends on uninitialised ... artifact: 86edc7e645 user: pointsman
15:36 • Ticket [1fe745559a]: 3 changes artifact: 784807c72a user: jan.nijtmans
15:35
Fix [1fe745559a]: 8.7, 9.0: Conditional jump or move depends on uninitialised value in Tcl_UniCharTo... closed check-in: 4e0909a17e user: jan.nijtmans tags: bug-1fe745559a
14:26 • New ticket [1fe745559a] 8.7, 9.0: Conditional jump or move depends on uninitiali... artifact: a8d1e2ee03 user: pointsman

8.7, 9.0: Conditional jump or move depends on uninitialised value in Tcl_UniCharToUtf

Closed / Fixed1fe745559aed47f050b3ba7a5adfae8511bc0a56Created 5 years agoUpdated 5 years ago
Descriptionplain2022-02-07 14:26:39
This script:

foreach str {
    \uD802
} {
    puts [string length $str]
}

running under valgrind with a -DPURIFY 8.7 or 9.0 build (both current branch head)
reports:

 Conditional jump or move depends on uninitialised value(s)
    at 0x4DFD828: Tcl_UniCharToUtf (tclUtf.c:234)
    by 0x4DCD952: TclParseBackslash (tclParse.c:955)
    by 0x4E00DA8: TclCopyAndCollapse (tclUtil.c:806)
    by 0x4DBAD22: SetListFromAny (tclListObj.c:2087)
    by 0x4DB7BBA: TclListObjCopy (tclListObj.c:433)
    by 0x4CA5B11: EachloopCmd (tclCmdAH.c:2681)
    by 0x4CA5673: TclNRForeachCmd (tclCmdAH.c:2577)
    by 0x4C8EB4B: Dispatch (tclBasic.c:4923)
    by 0x4C8EBD1: TclNRRunCallbacks (tclBasic.c:4963)
    by 0x4C8E499: Tcl_EvalObjv (tclBasic.c:4682)
    by 0x4C90950: TclEvalEx (tclBasic.c:5838)
    by 0x4DB0C85: Tcl_FSEvalFileEx (tclIOUtil.c:1782)
  Uninitialised value was created by a heap allocation
    at 0x4A34E6D: malloc (vg_replace_malloc.c:309)
    by 0x4C81F7F: TclpAlloc (tclAlloc.c:699)
    by 0x4DC8296: Tcl_InitStringRep (tclObj.c:1824)
    by 0x4DBAC88: SetListFromAny (tclListObj.c:2075)
    by 0x4DB7BBA: TclListObjCopy (tclListObj.c:433)
    by 0x4CA5B11: EachloopCmd (tclCmdAH.c:2681)
    by 0x4CA5673: TclNRForeachCmd (tclCmdAH.c:2577)
    by 0x4C8EB4B: Dispatch (tclBasic.c:4923)
    by 0x4C8EBD1: TclNRRunCallbacks (tclBasic.c:4963)
    by 0x4C8E499: Tcl_EvalObjv (tclBasic.c:4682)
    by 0x4C90950: TclEvalEx (tclBasic.c:5838)
    by 0x4DB0C85: Tcl_FSEvalFileEx (tclIOUtil.c:1782)
Referenced by2
  • 173c09dcf8Fix [1fe745559a]: Conditional jump or move depends on uninitialised value in Tcl_UniCharToUtf check-in2022-02-07 22:16:34
  • 4e0909a17eFix [1fe745559a]: 8.7, 9.0: Conditional jump or move depends on uninitialised value in Tcl_UniCharToUtf check-in2022-02-07 15:35:09
jan.nijtmanswiki2022-02-07 15:36:11

Proposed fix (8.7) here: [4e0909a17e33629c]

Thanks for the report!

pointsmanplain2022-02-07 21:20:23
Yes, with [4e0909a17e33629c] valgrind doesn't complain about this anymore. Seems this was it.

For the record, I must have botched my test script, while minimizing it. At least I don't see the valgrind report anymore with the original test script with core-8-branch. But I see it with this one:

foreach str {
    \uDFFF
} {
    puts [string length $str]
}

While this shows the problem relibale with 8.7 it is gone with [4e0909a17e33629c].
jan.nijtmanswiki2022-02-07 22:22:48

Merged now to core-8-branch and trunk. Closing.

Thanks for your confirmation that it's now fixed!

Log in (anonymous is fine) to add a comment.