<i> lset with 2+ indices on an unshared lseq list is a use-after-free (crash)</i> status still Open with 3 other changes
by
.
D 2026-10-30T09:12:21.896
J icomment <tt>TclListObjSetElement()</tt>\spanics\sonly\sif\sthe\slist\sit\smodifies\s(<tt>parentList</tt>)\sis\sshared,\sand\sit\sis\sunshared\sat\sthis\spoint.\sThe\selement\smay\sbe\sshared:\s<tt>TclListObjSetElement()</tt>\stakes\sits\sown\sreference,\sand\sthe\scode\sright\safter\sthe\scall\smakes\sa\scopy\sif\s<tt>subListObj</tt>\sbecame\sshared.\sThe\sadded\s<tt>Tcl_IncrRefCount()</tt>/<tt>Tcl_DecrRefCount()</tt>\sonly\skeeps\sthe\sold\selement\salive\swhile\sit\sis\sstored\sback,\ssince\sit\smay\sbe\sheld\sonly\sby\sthe\scache\sof\sthe\sabstract\slist,\swhich\sis\sfreed\sduring\sthe\scall.\n\nI\scannot\sreproduce\sthe\scrash\swith\sthe\scurrent\smain\s(1436d27450)\sor\s9.0\s(336b75d084),\son\sLinux\s(also\sunder\svalgrind)\sand\son\sWindows\s11\s(MSVC):\n<verbatim>\n%\sset\sm\s[lseq\s5]\n0\s1\s2\s3\s4\n%\slset\sm\s{2\s0}\sX\n0\s1\sX\s3\s4\n</verbatim>\nWhat\sbuild\sand\splatform\sdid\syou\suse?
J login serhiy.storchaka
J mimetype text/x-fossil-wiki
K 526b01c0b9921b90618f82c398dc2684a60a053a
U serhiy.storchaka
Z 1416da12fb9edcd6f2ae15b30ae7ba24