Skip to content
Tcl Source Code Artifact [0fa851aeff]
Login

Artifact [0fa851aeff]

Artifact 0fa851aeff510886db86e819b9856bdb9c787563:

Ticket change [0fa851aeff] - New ticket [2629338fffffffff|2629338fff] <i>segfault on traced vars in TclCallVarTraces</i>. by nobody on 2009-02-23 04:40:29.
D 2009-02-23T04:40:29
J assignee msofer
J cmimetype text/plain
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.\n\nThe\sissue\sis\scommonly\striggered\sby\stdom,\swhich\smakes\sextensive\suse\sof\svariable\straces\s(well,\sone\sper\sdom\sobject.)\n\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.\n\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.\n\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.)\n\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.\n\nI\swill\sattach\sthe\spatch.
J foundin obsolete:\s8.5.6
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 07.\sVariables
J title segfault\son\straced\svars\sin\sTclCallVarTraces
J type Bug
K 2629338fffffffffffffffffffffffffffffffff
U nobody
Z a83450e5e59062343cdb665a207b4ced