Artifacts Associated With Ticket a30d273cfb92ade6
Ticket change [da0cfb9316] (rid 198337) by chrstphrchvz on 2022-02-19 09:06:31:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Example scripts and corresponding output with UBSan (<tt>-fsanitize=signed-integer-overflow</tt>) errors: <ol><li><pre> set f [open /dev/zero [list RDONLY BINARY]] fconfigure $f -buffersize [expr {2**20}] set z [read $f [expr {2**30}]] proc as2 {s} {return [string cat [encoding convertto utf-8 a] $s $s]} set az2 [as2 $z] </pre> <pre> <span style="font-weight:bold">tcl/generic/tclExecute.c:2770:17:<span style="color:firebrick"> runtime error: </span>signed integer overflow: 1073741824 + 1073741824 cannot be represented in type 'int'</span> max size for a Tcl value (2147483647 bytes) exceeded </pre>(tclsh aborted)</li> <li><pre> set a [string repeat [string repeat a [expr {2**10}]] [expr {2**20}]] proc us2 {s} {return [string cat {u} $s $s]} set ua2 [us2 $a] </pre><pre> <span style="font-weight:bold">tcl/generic/tclExecute.c:2778:17:<span style="color:firebrick"> runtime error: </span>signed integer overflow: 1073741824 + 1073741824 cannot be represented in type 'int'</span> max size for a Tcl value (2147483647 bytes) exceeded </pre>(tclsh aborted)</li> <li><pre> set a [string repeat [string repeat a 1023] 1049601] proc uus2 {s} {return [string cat {uu} $s $s]} set uua2 [uus2 $a] </pre> <pre> <span style="font-weight:bold">tcl/generic/tclExecute.c:2812:17:<span style="color:firebrick"> runtime error: </span>signed integer overflow: 2 + 2147483646 cannot be represented in type 'int'</span> max size for a Tcl value (2147483647 bytes) exceeded </pre>(tclsh aborted)</li> <li><pre> set a [string repeat [string repeat a 1023] 1049601] proc zs2 {s} {return [string cat [expr 0] $s $s]} set za2 [zs2 $a] </pre> <pre> <span style="font-weight:bold">tcl/generic/tclExecute.c:2820:25:<span style="color:firebrick"> runtime error: </span>signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'</span> </pre>(tclsh exited normally)</li> <li><pre> set a [string repeat [string repeat a 1023] 1049601] proc us2 {s} {return [string cat {u} $s $s]} set ua2 [us2 $a] </pre><pre> <span style="font-weight:bold">tcl/generic/tclExecute.c:2827:7:<span style="color:firebrick"> runtime error: </span>signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'</span> </pre>(tclsh exited normally)</li> <li><pre> set f [open /dev/zero [list RDONLY BINARY]] fconfigure $f -buffersize [expr {2**20}] set z [read $f [expr {2**30}]] proc s2 {s} {return [string cat $s $s]} set z2 [s2 $z] </pre><pre> <span style="font-weight:bold">tcl/generic/tclExecute.c:2848:17:<span style="color:firebrick"> runtime error: </span>signed integer overflow: 1073741824 + 1073741824 cannot be represented in type 'int'</span> max size for a Tcl value (2147483647 bytes) exceeded </pre>(tclsh aborted)</li> </ol> The attached patch prevents these. - 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: "18. Commands M-Z"
- title initialized to:
signed integer overflow in TEBCResume() for INST_STR_CONCAT1
- type initialized to: "Patch"
Add attachment "a30d273cfb.diff" [0e1aefaf7b] (rid 198338) by chrstphrchvz on 2022-02-19 09:07:04.