Skip to content
Tcl Source Code Artifact [452a317ccb]
Login

Artifact [452a317ccb]

Artifact 452a317ccbce7ce937abb49f65e1b2d3ac965492a144e4b18230861eee90582b:

Ticket change [452a317ccb] - New ticket [5ee01098824881b5|5ee0109882] <i>lseq list conversion results in attempt to access freed memory</i>. by pooryorick on 2023-05-17 11:50:56.
D 2023-05-17T11:50:56.362
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment In\sa\sbuild\sof\strunk\swith\s--enable-symbols\sand\sCFLAGS="-DPURIFY",\sthe\sfollowing\sscript\r\n\r\n<blockquote><code><verbatim>\r\ntrace\sadd\svariable\sone\swrite\s[list\s::apply\s[list\sargs\s{\r\n\terror\s{this\serror}\r\n}\s[namespace\scurrent]]]\r\nset\sone\s[lindex\s[lreplace\s[lseq\s1\s2]\s1\s1\shello]\s0]\r\n</verbatim></code></blockquote>\r\n\r\nResults\sin\sthe\sfollowing\serror:\r\n\r\n<blockquote><code><verbatim>\r\nmalloc():\sunaligned\sfastbin\schunk\sdetected\s3\r\n</verbatim></code></blockquote>\r\n\r\nThe\sreason\sis\sthat\s<code>lreplace</code>\sconverts\sthe\sinternal\srepesentation\r\nfrom\s<code>tclArithSeriesType</code>\sto\s<cod>tclListType</code>,\sand\r\n<code>SetListFromAny()</code>\shandles\sthe\sarithmetic\sseries\sspecially,\r\nforgetting\sto\sincrement\sthe\sreference\scount\swhen\seach\s<code>Tcl_Obj</code>\sis\r\nadded\sto\sthe\slist.\s\sSee\r\n[https://core.tcl-lang.org/tcl/file?udc=1&ln=3323&ci=57e46213e1e5414a&name=generic%2FtclListObj.c|this\r\nloop].
J is_private 0
J login pooryorick
J priority 5\sMedium
J private_contact 2b2275eab1118e1fab0016cf1c5702893c6af86c
J resolution None
J severity Minor
J status Open
J submitter pooryorick
J subsystem -\sNew\sBuiltin\sCommands
J title lseq\slist\sconversion\sresults\sin\sattempt\sto\saccess\sfreed\smemory
J type Bug
K 5ee01098824881b5500e4692bcfa74eb853bc795
U pooryorick
Z 0e67d99c6a78bae8acc209ed94b5ae07