Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2023-04-27
13:56 • Ticket [d4ede611a7] scan %s truncates strings at UINT_MAX status still Close... artifact: 63f6e18975 user: jan.nijtmans
13:47 • Ticket [d4ede611a7]: 5 changes artifact: daca82a33a user: apnadkarni
07:16 • Ticket [ab123cfd3d] ValidateFormat(): signed integer overflow status still O... artifact: 2adb0fc3d3 user: chrstphrchvz
07:10 • Ticket [d4ede611a7] scan %s truncates strings at UINT_MAX status still Close... artifact: af150b5d84 user: chrstphrchvz
2023-04-24
14:52 • Closed ticket [d4ede611a7]. artifact: 1e51d5fc46 user: apnadkarni
14:51
Fix [d4ede611a7] - scan bigdata check-in: acaa559a27 user: apnadkarni tags: trunk, main
10:02
Fix for bug [d4ede611a7] (scan) check-in: ce85c34ed2 user: apnadkarni tags: bug-d4ede611a7
2023-04-23
03:25
Bug [d4ede611a7] (scan) - in progress check-in: 717c2c72f0 user: apnadkarni tags: bug-d4ede611a7
2023-04-22
18:00 • Ticket [d4ede611a7] scan %s truncates strings at UINT_MAX status still Open ... artifact: a054ea6b05 user: apnadkarni
2023-04-12
16:17 • Ticket [d4ede611a7]: 3 changes artifact: e26943061d user: apnadkarni
2023-04-09
23:50 • New ticket [d4ede611a7]. artifact: a47396a4c1 user: apnadkarni

scan %s truncates strings at UINT_MAX

Closed / Fixedd4ede611a7a7c802d7c5b42c93dded85d41b7184Created 4 years agoUpdated 4 years ago
Descriptionmarkdown2023-04-09 23:50:16
% set s [string repeat x 0x100000000] ; string length $s
4294967296
% string length [scan $s %s]
4294967295
Referenced by3
apnadkarni Ticket [d4ede611a7]: 3 changes [History diff]2023-04-12 16:17:40
apnadkarnimarkdown2023-04-22 18:00:34

Other issues with scan.

Large positional qualifiers.

scan abc {%2147483648$s} -> memory access violation

Large width specifiers are truncated.

% set s [testbigdata string 0x10000000a]; string length $s
4294967306
% scan $s %4294967300s%s x y
2
% string length $y
11
% string length $x
4294967295
apnadkarniplain2023-04-24 14:52:43
Fixed in [acaa559a27].
chrstphrchvzwiki2023-04-27 07:10:08

scan abc {%2147483648$s} crashes on 8.6 and 8.7 as well. Can the fix and scan-19.3 be backported?

apnadkarnimarkdown2023-04-27 13:47:21

The back porting to 8.6/8.7 has relevance to all the "bigdata" tests and fixes, not just this one. In fact it also has relevance to 32-bit Tcl9.

However, these tests and fixes target bugs that are present for arguments with lengths that are valid for the build in question. So for 64-bit builds in Tcl9, 0x100000000 is a valid string / list length and that is what these tests and fixes address.

In particular, tests for lengths that are not supported by the build comprise a different set of tests and are harder to construct. They would be more appropriate for the 8.x series.

Also, given limited time and resources, I personally do not plan on spending any time making the 8.x series robust dealing with large data. I see that time better spent on 9.x.

So, the short answer after a long rationalization :-), no I'm not planning on a back port.

jan.nijtmansplain2023-04-27 13:56:49
> Can the fix and scan-19.3 be backported?

Anyone can implement/propose a backport for this fix to 8.6/8.7.
Log in (anonymous is fine) to add a comment.