Skip to content
Tcl Source Code Artifact [20dd8a47a1]
Login

Artifact [20dd8a47a1]

Artifact 20dd8a47a1e6c7e0dbf6976a36def2ddb292ae8f:

Ticket change [20dd8a47a1] - Closed ticket [2629338fffffffff|2629338fff]: <i>segfault on traced vars in TclCallVarTraces</i> plus 6 other changes by dgp on 2014-10-09 14:14:42.
D 2014-10-09T14:14:42.328
J closedate 2456940.09354546
J closer dgp
J comment I've\shad\sa\sbug\spreventing\sme\sfrom\supgrading\smy\sproduct\sto\s8.5\sfor\ssome\stime,\sbut\sI've\snever\sbeen\sable\sto\snarrow\sit\sdown\sto\sa\ssimple\sexample.\sSo,\sIn\slieu\sof\sthat,\shere's\sa\spatch\sthat\sfixes\sthe\sbug.\r\n\r\nThe\sissue\sis\scommonly\striggered\sby\stdom,\swhich\smakes\sextensive\suse\sof\svariable\straces\s(well,\sone\sper\sdom\sobject.)\r\n\r\nThe\score\sissue\sis\sessentially\sthat\sTclUnsetVarStruct\scalls\sall\sthe\sunset\straces\son\sthe\svariable,\sthen\ssets\sabout\sdeleting\sthe\straces.\sThe\sproblem\sis,\sthe\straces\smay\shave\salready\sdeleted\sthemselves\swhen\sthey\swere\scalled.\s\s(which\stdom's\salways\sdo.)\sIn\sparticular,\sthe\s'head'\sof\sthe\slist\smay\shave\sremoved\sitself.\r\n\r\nIn\sthat\scase,\sTclUnsetVarStruct\sstarts\siterating\sover\sthe\sitems\sto\sbe\sfreed\swhile\slooking\sat\salready-freed\smemory.\sSince\sit\swas\sfreed\sso\srecently,\sit\sgets\saway\swith\sthis\sin\sthe\snormal\scase,\sbut\son\srare\soccasions,\sthe\smemory\shas\salready\sbeen\sreallocated.\sHilarity\sensues.\r\n\r\nI'm\snot\ssure\sif\sthis\scounts\sas\sthe\ssame\sbug\sor\snot,\sbut\sTclDeleteNamespaceVars\sneglects\sto\supdate\sthe\snextTracePtr\sfor\sthe\sactiveVarTracePtr\son\sthe\sinterp,\swith\ssimilar\sresults.\sI've\snever\sseen\sthat\sbug\strigger\sanywhere\sbut\swindows,\sbut\sit\sshows\sup\sfairly\soften\sthere\sin\sour\sproduct\s(on\stcl\s8.4.13\sas\swell\sas\s8.5.6.)\r\n\r\nI\salso\snoticed\sthat\sthe\sVarTrace\sentries\sare\sfreed\swith\s'Tcl_EventuallyFree'\swithout\supdating\stheir\snext\spointers.\sSince\sanother\scall\smight\shave\sthe\scurrent\sobject\spreserved,\sbut\snot\sthe\snext\sone,\sthe\scurrent\sobject\smight\sstick\saround\sand\scontinue\sbeing\sused\swhile\sthe\snext\sobject\shas\salready\sbeen\sfreed.\sSo\sthe\spatch\sincludes\sa\schange\sto\snull\sout\sthe\snext\spointer\swhen\scalling\seventuallyfree.\sI'm\snot\ssure\sif\sthere's\sa\suser-visible\sbug\sassociated\swith\sthat\sor\snot.\sI\sdid\sa\scursory\scheck\sfor\ssimilar\santipatterns\sin\sother\sfiles\sfor\svar\straces\s(and\sfound\snone)\sbut\sdidn't\sbother\schecking\sother\slink\slists.\r\n\r\nI\swill\sattach\sthe\spatch.
J login dgp
J mimetype text/plain
J severity Minor
J status Closed
K 2629338fffffffffffffffffffffffffffffffff
U dgp
Z c0b0c04303ed783c492c9e67753b22b1