Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-29
11:56 • Closed ticket [b24becc2ab]: Crash on indexing into abstract lists plus 6 oth... artifact: 9babffd7b3 user: apnadkarni
11:53
Fixes for [b24becc2ab] and [0c82728f85] abstract list crashes and shimmers check-in: 54a03368ce user: apnadkarni tags: trunk, main
2026-10-28
11:26
9.1 fixes for [b24becc2ab] and [0c82728f85] abstract list crashes and shimmers closed check-in: 7c3bcf94bb user: apnadkarni tags: bug-0c82728f85-91
09:56
Rewrite INST_LIST_INDEX bytecode.See [b24becc2ab]. check-in: d27dbcd1b3 user: apnadkarni tags: core-9-0-branch
2026-10-27
16:49
Rewrite INST_LIST_INDEX bytecode.See [b24becc2ab]. closed check-in: 247b9a8544 user: apnadkarni tags: bug-0c82728f85
10:16 • Ticket [b24becc2ab] Crash on indexing into abstract lists status still Open ... artifact: 0000c5d29e user: apnadkarni
2026-10-26
12:26
Fix abstract list [b24becc2] lindex crash and [0c82728f] shimmer check-in: 2ca7e61f73 user: apnadkarni tags: core-9-0-branch
2026-10-25
06:02 • Ticket [b24becc2ab] Crash on indexing into abstract lists status still Open ... artifact: 95acd80b96 user: apnadkarni
05:59 • Ticket [b24becc2ab]: 3 changes artifact: a71fd2488a user: apnadkarni
05:51
More shimmering fixes including [b24becc2ab] crash check-in: 767b4e5980 user: apnadkarni tags: bug-0c82728f85
04:14 • Ticket [b24becc2ab] Crash on indexing into abstract lists status still Open ... artifact: d1f5cb614e user: apnadkarni
03:16 • New ticket [b24becc2ab]. artifact: 19f6091a8b user: apnadkarni

Crash on indexing into abstract lists

Closed / Fixedb24becc2ab302f95e395d9dc2586d421969eee18Created 39 days agoUpdated 34 days ago
Descriptionmarkdown2026-10-25 03:16:59
% package req Tcl
9.0.4
% set x [lseq 1]; lindex $x $x
-> NULL pointer access crash
Referenced by5
apnadkarnimarkdown2026-10-25 04:14:24
% set x [lseq 1]; [subst lindex] $x $x
0

so crash only occurs on compiled path where the code does not guard against shimmering. A general pattern that the whole code base needs to be examined for is

if (TclObjTypeHasProc(objPtr, XXX)) {
   ...some code...
   TclObjTypeXXX(objPtr...)
}

where "some code" shimmers objPtr so the TclObjTypeXXX call is no longer valid.

apnadkarniplain2026-10-25 05:59:59
Proposed fix is in place in [b24becc2ab] as part of the bug-0c82728f85 branch that is dealing with various shimmering issues. Leaving open as similar occurrences need to be hunted down.
apnadkarniplain2026-10-25 06:02:29
As an aside, it may be worth optimizing the Tcl_GetIndexFromObj/Tcl_GetNumberFromObj/ParseNumber call tree to not shimmer single element lists but instead parse the first element instead.
apnadkarnimarkdown2026-10-27 10:16:07

Another shimmering crash for the record. This one happens when the abstract list does not define the (optional) indexProc method.

% set l [lstring -not INDEX 0]
0
% lindex $l $l
-> crash
apnadkarniplain2026-10-29 11:56:44
Fixed for 9.1 in [54a03368ce] and 9.0 in [d27dbcd1b3].
Log in (anonymous is fine) to add a comment.