Skip to content
Tcl Source Code Artifact [3fa66da561]
Login

Artifact [3fa66da561]

Artifact 3fa66da561262093fb694c8a241552029a0df2d2cbdb3e664c475889cffc0ad2:

Ticket change [3fa66da561] - Ticket [4eb3a155ac6f73f4|4eb3a155ac] <i>apply causes memory corruption / crash</i> status still Open with 3 other changes by sebres on 2022-07-27 15:29:13.
D 2022-07-27T15:29:13.797
J icomment As\sdiscussed\sin\stclchat\s(IRC),\sthe\sfix\sof\sAshok\scovers\sonly\sone\scase,\sas\swell\sas\sbasically\stoo\sheavy\sbecause\swould\salways\sreset\sthe\sbody\sof\slambda,\sthus\scould\sunintentionally\slost\slarge\sinternal\srepresentation\sof\ssome\sobject\sif\sbody\sis\sevaluated\sas\sa\slist,\se.\sg.\sbasically\sit\swouldn't\sbe\sable\sanymore\sevaluate\slambdas\sas\spure-list\s(using\sTcl_EvalObjv/TclNREvalObjv),\sbecause\swill\salways\sshimmer\sto\sstring.\r\n\r\nAnyway,\sI\scould\sfind\sthe\sreal\sreason\sof\sthe\sissue\sand\sit\slooks\smuch\smore\sgrave\sas\sassumed\s-\sthe\sprocPtr\sobject\s(of\stype\stclProcBodyType)\sis\sstored\s(but\snot\sreferenced)\sin\sits\sbytecode\s(in\sobject\sof\stype\stclByteCodeType),\sbut\sif\slambda/proc/whatever\sbecomes\sfree,\scodePtr->procPtr\sremains\sunchanged,\salthough\sprocPtr\sdoesn't\sexists\sanymore,\sbecause\sreleased\sin\sTclProcCleanupProc.\s\r\nAnd\ssince\sByteCode\swould\snot\sbe\srecompiled\slater,\swith\sthat\sconstellation\sI\ssee\sdozen\scases\swere\sit\scan\ssegfault\slater,\sAshok\sfound\sonly\sone\scase.\r\n\r\nI\srebased\sthe\sbranch\sapn-apply-bug\sto\s8.6\s(where\sit\sis\salso\spretty\sreproducible)\sand\swill\sprovide\sa\scommon\ssolution\sfor\sthe\sissue\s(reset\scodePtr->procPtr\sin\sTclProcCleanupProc).
J login sebres
J mimetype text/x-markdown
K 4eb3a155ac6f73f48b270a19e543841d26bf2e6f
U sebres
Z 6d9674a4b5b1c3eb1471309d176f019b