Artifacts Associated With Ticket 05ff16e799
Ticket change [c22669188a] (rid 199966) by chrstphrchvz on 2022-04-07 18:58:01:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Example script (assumes your Tcl already has the fix for [0e8fd6c6d5]): <blockquote> <pre> set z [string repeat "\u0000" 1073741820] puts stderr [::tcl::unsupported::representation $z]<br /> # create string obj with longest possible unicode rep and no string rep set zz [string replace $z 0 1 $z] puts stderr [::tcl::unsupported::representation $zz]<br /> # force generating string rep (should abort due to exceeding max size for a Tcl value) set ZZ [string toupper $zz] puts stderr [::tcl::unsupported::representation $ZZ] </pre> </blockquote> Output containing UBSan <tt>-fsanitize=signed-integer-overflow</tt> error (which the attached patch prevents): <blockquote> <pre> value is a pure string with a refcount of 2, object pointer at 0x604000041490, string representation "..." value is a string with a refcount of 2, object pointer at 0x604000041c10, internal representation 0x316793800:0xbebebebebebebebe, no string representation <span style="font-weight:bold">tcl/generic/tclStringObj.c:3344:7: <span style="color:firebrick">runtime error:</span> signed integer overflow: 2147483646 + 2 cannot be represented in type 'int'</span> max size for a Tcl value (2147483647 bytes) exceeded </pre> (tclsh aborted) </blockquote>
- foundin initialized to: "core-8-6-branch"
- is_private initialized to: "0"
- login: "chrstphrchvz"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "chrstphrchvz"
- subsystem initialized to: "10. Objects"
- title initialized to:
signed integer overflow in ExtendStringRepWithUnicode()
- type initialized to: "Patch"
Add attachment "05ff16e799.diff" [489bd977ce] (rid 199967) by chrstphrchvz on 2022-04-07 19:12:22.
Ticket change [0e8f283693] (rid 199975) by jan.nijtmans on 2022-04-08 09:17:49:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2459677.88737466"
- closer changed to: "jan.nijtmans"
- icomment:
Merged to 8.6 and 8.7 (no problem on 9.0) Thanks!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"