Skip to content
Tcl Source Code Artifact [f76c6d6991]
Login

Artifact [f76c6d6991]

Artifact f76c6d6991a5e4784fffd34f3b877c161e47e3e5:

Ticket change [f76c6d6991] - Ticket [3532959fffffffff|3532959fff] <i>free lambda after interp -&gt; crash</i> status still Open with 4 other changes by andreas_kupries on 2012-06-09 00:40:49.
D 2012-06-09T00:40:49
J icomment Discussion\son\sthe\sTcler's\sChat,\sfor\sposterity.\sSummary\sin\sfurther\scomments.\n\n[08:44]aku.\n[08:45]akudgp,\smiguel:\swill\stry\sto\sget\swork\son\sthe\slambda\scrash\sdone\sduring\sthe\sweekend\sor\searly\snext\sweek.\n[08:45]dgpnearly\sdone\n[08:46]akunearly\sdone\s-\sFixing\sthe\slambda\scrash\s?\n[08:46]dgpyes\n[08:46]akuOh!\sThank\syou!\n[08:46]dgpsee\sbranch\sfor\swork\sin\sprogress.\n[08:47]dgpbranch\sworks\sfor\snormal\sbuilds\sbut\sstill\sbreaks\smem\saccess\srules,\sso\swill\scrash\sin\smem\sdebug\sbuild.\n[08:48]akuOk\n[08:49]dgpwould\slike\smore\sambitious\srevisions\sthat\seliminate\sthe\sprocPtr->iPtr\sfield\sentirely,\sbut\slack\sthe\sfamiliarity\sto\sdo\sit.\n[08:49]dgplots\sof\slurking\sassumptions\sthrough\shere.\n[08:52]akuVery\slikely.\s...\sI\sbelieve\sI\ssee\show\syou\sare\sdoing\sit\s...\sDuring\siPtr\steardown\syou\sfollow\sthe\strail\sin\sthe\shash\sto\sthe\sproc\sstructures\sand\ssever\sthe\sconnection\sexplicitly,\sand\sin\sthe\sproc\steardown\syou\scheck\sfor\sthat\sand\sbail\sout\searly\n[08:53]akuUnclear\s(from\slooking\sat\spatch)\show\sit\sbreaks\sthe\smem-debug\n[08:53]dgpThe\scrashing\sexample\sis\sone\sthat\snever\sstores\sanything\sin\slinePBodyPtr\sin\sthe\sfirst\splace.\n[08:54]dgpJust\sneed\ssome\ssensible\sway\sto\srecall\sthat,\sand\snot\sattempt\sto\sfree\swhat\syou\snever\screated.\n[08:54]akuOh.\sHm.\n[08:55]dgpso\swe\shave\siPtr\spointing\sto\sfreed\smemory,\siPtr->linePBodyPtr\sis\snot\shappy.\n[08:55]dgpthough\swe\susually\sdon't\snotice\sthat\swithout\smem\sdebugging\sturned\son.\n[08:56]akuAh,\sI\ssee.\sGuards\sand\s0xdeadbeef\n[08:58]dgpThe\sFindHashEntry\scall\sin\sProcCompileProc\shas\sthe\spotential\sto\shave\ssimilar\strouble,\sbut\smay\sbe\ssafe\sdue\sto\sother\scrosschecks\salready\sin\splace\sfor\sother\sreasons.\n[08:59]akuMight\sit\sbe\ssafe\sbecause\s'proc's\scannot\sexist\soutside\sof\sthe\sinterpreter,\sas\svalue,\si.e.\sTcl_Obj*,\slike\slambdas\s?\n[08:59]dgpIt\swould\sbe\ssafe\sis\swe\salready\sprevent\scalling\sProcCompileProc\son\sfreed\sinterps.\n[09:00]dgper,\sif\swe\sal.\n[09:01]akuHm.\sI\sdo\snot\sremember\senough\sof\sthe\sproc\smachinery\sto\sbe\sable\sto\ssay\sif\sthat\sis\strue\sor\snot.\sI.e.\snot\sdoing\sbcc\sduring\sinterp\steardown\n[09:32]dgpaku,\scan\syou\scomment\son\swhy\sthis\sdata\sis\sstored\sin\sa\shash\stable\sin\sthe\sinterp\sin\sthe\sfirst\splace?\n[09:33]dgpIf\swe\swant\sto\sstore\swhat\sCmdFrame\sis\sassociated\swith\sa\sProc,\swhy\sdon't\swe\sjust\sadd\sa\sCmdFrame\s*\sfield\sto\sthe\sProc\sstruct\sand\sstore\sit\sdirectly?\s\sWhat\sdoes\sthe\sindirection\sdo\sfor\sus?\n[09:33]akuYes.\sI\swas\snot\sallowed\sto\smodify\spublicly\svisible\sstructures,\sso\sI\sput\sthe\sdata\sinto\shash\stables\skeyed\sby\sthe\spointers\sto\sthe\srelevant\sstructures\n[09:34]dgpok,\sso\sa\sconstraint\sis\snot\sto\smodify\sthe\sdefinition\sof\sProc\s?\n[09:34]akuYes\n[09:34]dgpho\sboy\n[09:35]akuBasically,\swhen\sCisco\scame\sto\sus\swith\sthe\srequest\sfor\swhat\sbecame\stip\s280\sthey\sdidn't\swant\sto\schange\sthe\sbinary\sAPI\n[09:35]dgpthe\sprivate\sone.\s\n[09:36]akustruct\sProc\sis\sprivate\s?\n[09:36]dgptclInt.h\n[09:37]dgpYet\sanother\sway\sis\sto\skeep\sthe\sindirection\svia\stable\sstrategy,\sbut\shang\sthat\stable\son\sthe\sthread\sinstead\sof\sthe\sinterp.\n[09:37]akuHm.\sI\swonder\show\sI\smissed\sthat\swhen\sI\swrote\sthings.\n[09:38]dgpMy\sguess\sis\sthat\sit's\snot\s*really*\sprivate.\n[09:38]dgpas\sin\ssomeone\simportant\ssomewhere\sneeds\sit\snot\sto\schange.\n[09:38]akuRight!\stbcload,\stclcompiler\slikely\shave\saccess\sto\sthese,\smaking\sthem\ssemi-public\n[09:39]akuper-thread\sdata\s...\sThat\scould\swork.\n[09:39]dgpSome\sforms\sof\ssemi-public\spermit\sextension.\s\sIs\sthis\sone?\n[09:40]aku...\sThinking\s...\sI\sam\snot\ssure\s...\n[09:40]akuWith\stbcload\setc\sin\smind\sI\slikely\ssimply\swent\sall-conservative\swhen\swriting\sthe\scode,\si.e.\sassuming\sthat\sextension\sis\snot\spossible.\n[09:41]dgpKey\squestion\swould\sbe\swhether\sany\sthird\sparty\sthings\sallocate\sProcs\n[09:41]dgpor\sif\sthey\sjust\smanipulate\sProcs\sallocated\sby\sTcl\svia\s(Proc\s*)\svalues.\n[09:42]akuI\ssee.\sWell,\stbcload/tclcompiler\sare\sprime\scandidate\sfor\ssuch\s3rd-party\sallocating\sprocs\n[09:42]dgpsome\sversion\sof\sthem\sare\sin\sSF\sCVS?\n[09:43]akuSome\solder\sversion,\syes.\sThe\sbasic\sstructure\sshould\showever\sbe\sstill\sgood.\n[09:44]akuWould\shave\sto\sask\stclguy\sregarding\sstance\son\sopening\sour\schanges/updates\sto\sthese\stwo\n[09:48]dgpItcl\s3\spokes\sinto\sProc,\sbut\sonly\sthrough\sa\s(Proc\s*)\n[10:09]dgpno\sluck\sfinding\stbcload/tclcompiler\ssources.\n[10:10]akudbgp\s-\sThe\sproject\sis\stclpro\s-\shttp://tclpro.cvs.sourceforge.net/tclpro/\n[10:11]akus/dbgp/dgp/\n[10:11]dgpmaybe\sI\schecked\sout\sthe\swrong\smodule?\n[10:12]dgpyup.\s\sWhen\s"Browse\sCVS"\sfails,\sI'm\sblind.\s\sthanks.\n[10:16]dgpok,\stclcompiler\sallocates\sthe\sProc\sstruct.\n[10:19]dgpso\sthe\sonly\spossible\sanswers\sin\sthe\sconstraints\sare\sto\seither\shave\severy\sProc\sTcl_Preserve()\sits\sinterp,\n[10:20]dgpor\srework\sso\sthe\stable\sisn't\sattached\sto\sthe\sinterp\sso\swe\sdon't\scare\sabout\ssyncing\sdeletions.\n[10:21]jenglishdgp\s-\sISTR\sstruct\sTcl_Interp\shas\sa\slittle-known\sweak\sreference\sfacility\sthat's\scheaper\sthan\sTcl_Preserve()\s...\n[10:21]\s\s\s*\sjenglish\schecks\s...\n[10:21]dgpthe\sHandle?\n[10:21]jenglishYeah,\sthat's\sit.\n[10:21]dgpIf\sI\swere\sfree\sto\schange\sthe\sProc\sstruct,\sI'd\suse\sthat.\n[10:22]dgpBut\sthe\sProc\sstores\sa\s(Tcl_Interp\s*),\snot\sa\sTclHandle.\n[10:22]jenglishHm.\n[10:26]jenglishAre\syou\sconsidering\sTcl_Preserve()/Tcl_Release()\sper\sprocedure\sactivation,\sor\sper\sprocedure\screation?\n[10:26]dgpnot\sseriously,\sno\n[10:26]dgpShift\sto\sthread-based\stable\smakes\smore\ssense\sto\sme.\n[10:26]jenglishThat\sis:\swhen\syou\scall\s[proc\sfoo],\sor\swhen\syou\scall\s[foo]\sitself?\n[10:26]jenglishAh,\sOK.\n[10:28]jenglishTcl_Preserve\sis\sreally\srather\sexpensive,\sand\sgets\smore\sexpensive\sthe\smore\sit's\sused.\n[10:29]akujenglish\s-\sContext\sis\s3532959\n[10:30]jenglishI\sthink\sI'd\sprefer\sto\sbreak\swhatever\s(possibly\sonly\spostulated?)\sthird-party\sproprietary\spackages\sthat\sare\speeking\sinto\sTcl's\sprivates\sthan\smake\severybody\selse\spay\sthe\sprice\sof\sproliferating\sTcl_Preserve()s.\n[10:30]akuIIRC\sPreserve/Release\suse\slists,\si.e.\slinear\ssearch\setc.\n[10:30]jenglishPlus\sa\smutex\slock.\n\n
J login andreas_kupries
J mimetype text/plain
J username andreas_kupries
K 3532959fffffffffffffffffffffffffffffffff
U andreas_kupries
Z 15e504ddf0a86ae28a92cb781b1268c5