Skip to content
Tcl Source Code Artifact [756670b53a]
Login

Artifact [756670b53a]

Artifact 756670b53af15da67d5300af1268b17230b3120a:

Ticket change [756670b53a] - New ticket [2507159fffffffff|2507159fff] <i>Tcl_Command validity management</i>. by dgp on 2009-01-14 14:40:14.
D 2009-01-14T14:40:14
J assignee msofer
J cmimetype text/plain
J comment \nExtensions\shave\sa\snumber\sof\sways\nto\sget\shold\sof\sa\sTcl_Command\svalue.\nThe\sroutines\sTcl_(NR)Create(Obj)Command,\nTcl_GetCommandFromObj,\sTcl_FindCommand,\nTcl_CreateEnsemble,\sand\sTcl_FindEnsemble\nare\ssources\sof\sthem.\n\nOther\sTcl\sroutines\stake\sTcl_Command\ntoken\svalues\sas\sarguments.\n\nThe\spotential\sfor\strouble\sis\sa\nsituation\swhere\sthe\scommand\sis\sdeleted\nbetween\sthe\stime\sTcl\sgives\sthe\nTcl_Command\svalue\sto\sthe\sextension\nand\sthe\stime\sthe\sextension\spasses\sit\nback.\s\sSince\sa\s(Tcl_Command)\svalue\nis\sreally\sa\s(Command\s*),\sin\sthese\nsituations\sthe\sextension\smay\sbe\spassing\nback\sa\spointer\sto\smemory\sthat's\sfreed,\nor\seven\sreallocated\sto\sa\snew\spurpose,\nsetting\sthe\sstage\sfor\scrashes\sor\smemory\ncorruption.\n\nThe\sCommand\sstruct\shas\sa\srefCount\sfield\nto\skeep\sthe\sstruct\sfrom\sbeing\sfreed\swhile\nvarious\sparts\sof\sthe\sTcl\sinternals\sstill\nhold\sreferences\sto\sit.\s\sThis\sis\snot\sexposed\nto\sextensions,\sthough.\s\sThe\sTcl_Command\svalue\nhas\salso\snot\sbeen\sset\sup\sto\senable\sTcl_Preserve().\n\nThe\scallers\sof\sTcl_*Create*Command\sat\sleast\nhave\scontrol\sover\sthe\sTcl_CmdDeleteProc\sso\nthey\scan\serect\ssome\ssort\sof\snotification\sscheme\nabout\swhen\stheir\ssave\sTcl_Command\stoken\svalues\nare\sno\slonger\ssafe\sto\suse.\n\nThe\sTcl_Find*,\sTcl_GetCommandFromObj,\sand\nTcl_CreateEnsemble\sroutines\sdon't\shave\seven\nthat.\s\sPerhaps\sa\sdelete\strace\scan\sbe\sused\sto\nachieve\sthe\ssame\spurpose.\n\nThere\sseems\sto\sbe\sa\smismatch\sin\sthe\nresponsibilities\sof\san\sextension\s(don't\spass\nback\san\sinvalid\sTcl_Command)\sand\sthe\spower\ntools\sat\sits\sdisposal\s(routine\sto\stest\svalidity,\nor\snotification\swhen\svalidity\sis\sgoing\saway,\nor\sdocumented\sexamples\sof\show\sto\suse\swhat\stools\ndo\sexist\seffectively)\sto\slive\sup\sto\sthose\sresponsibilities.\n\nI\sput\sthis\sin\sthe\s[namespace]\scategory\sbecause\nI've\sencountered\sthis\sproblem\swith\stokens\nreturned\sby\sTcl_CreateEnsemble.\s\s\n
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter dgp
J subsystem 21.\s[namespace]
J title Tcl_Command\svalidity\smanagement
J type RFE
K 2507159fffffffffffffffffffffffffffffffff
U dgp
Z e97f740b8399df13488ea2aafb83f3bd