.
D 2000-10-26T00:56:03
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s3784\sBug\nVersion:\s8.2.2\nSubmitDate:\s'1999-12-06'\nLastModified:\s'2000-02-25'\nSeverity:\sCRIT\nStatus:\sClosed\nSubmitter:\stechsupp\nChangedBy:\shobbs\nOS:\sSunOS\nFixedDate:\s'2000-10-25'\nClosedDate:\s'2000-02-25'\n\n\nName:\sDevendra\sJoshi\n\nCustomShell:\nif\scondition\swas\sadded\sto\scheck\sthe\snullity\sof\scmdPtr\sbefore\scalling\sTclCleanupCommand\sand\sckfree\sfunction.\n\nComments:\nThe\sif\scondition\sis\sdesirable.\n\nReproducibleScript:\nWe\sare\susing\stcl\s8.2.2.\sWe\shave\screated\snew\sTcl\scommands\sto\swrap\sour\stechnology.\sA\sshared\slibrary\sis\screated\sfor\sthis\spurpose.\sBy\sloading\sthe\slibrary\sand\susing\sthese\scommands\swe\srun\ssome\sspecial\sjobs.\sIt\sruns\sfine\son\sWindows\sNT\sand\sSUN\s32\sbit\splatform\s(SUN\s5.6\sCompiler\s4.2C++).\n\nWe\sfaced\sproblem\son\sSUN\s64\sbit\splatform\s(SUN\s5.7\sCompiler\s5.0C++).\sIn\ssome\scommands\sthe\stcl\sscript\scrashed.\sThe\scrash\soccurrs\sat\sFreeCmdNameInternalRep()\sfunction\sin\stclExecute.c\sfile.\n\nObservedBehavior:\nThe\scrash\soccurs\swhen\sTclCleanupCommand\sand\sckfree\sprocesses\sNULL\svalues.\n\nstatic\svoid\nFreeCmdNameInternalRep(objPtr)\n\s\s\s\sregister\sTcl_Obj\s*objPtr;/*\sCmdName\sobject\swith\sinternal\n\s*\srepresentation\sto\sfree.\s*/\n{\n\s\s\s\sregister\sResolvedCmdName\s*resPtr\s=\n(ResolvedCmdName\s*)\sobjPtr->internalRep.otherValuePtr;\n\n\s\s\s\sif\s(resPtr\s!=\sNULL)\s{\n/*\n\s*\sDecrement\sthe\sreference\scount\sof\sthe\sResolvedCmdName\sstructure.\n\s*\sIf\sthere\sare\sno\smore\suses,\sfree\sthe\sResolvedCmdName\sstructure.\n\s*/\n\n\s\s\s\s\s\s\s\sresPtr->refCount--;\n\s\s\s\s\s\s\s\sif\s(resPtr->refCount\s==\s0)\s{\n\s\s\s\s\s\s\s\s\s\s\s\s/*\n\s\s\s\s\s*\sNow\sfree\sthe\scached\scommand,\sunless\sit\sis\sstill\sin\sits\n\s\s\s\s\s\s\s\s\s\s\s\s\s*\shash\stable\sor\sif\sthere\sare\sother\sreferences\sto\sit\n\s\s\s\s\s\s\s\s\s\s\s\s\s*\sfrom\sother\scmdName\sobjects.\n\s\s\s\s\s*/\n\n\s\s\s\s\s\s\s\s\s\s\s\sCommand\s*cmdPtr\s=\sresPtr->cmdPtr;\n\s\s\s\s\s\s\s\s\s\s\s\sTclCleanupCommand(cmdPtr);\s/*\scrashes\swhen\scmdPtr\sis\sNULL\s*/\n\s\s\s\sckfree((char\s*)\sresPtr);\s\n\s\s\s\s\s\s\s\s}\n\s\s\s\s}\n}\n\nDesiredBehavior:\nThis\sfunction\sshould\snot\scause\scrash.\n\nPatch:\nif\scondition\swas\sadded\sto\scheck\sthe\snullity\sof\scmdPtr\sbefore\scalling\sTclCleanupCommand\sand\sckfree\sfunction.\n\nAfter\sthis\smodification\sthe\stcl\scode\sis\sworking\sfine.\n\nstatic\svoid\nFreeCmdNameInternalRep(objPtr)\n\s\s\s\sregister\sTcl_Obj\s*objPtr;/*\sCmdName\sobject\swith\sinternal\n\s*\srepresentation\sto\sfree.\s*/\n{\n\s\s\s\sregister\sResolvedCmdName\s*resPtr\s=\n(ResolvedCmdName\s*)\sobjPtr->internalRep.otherValuePtr;\n\n\s\s\s\sif\s(resPtr\s!=\sNULL)\s{\n/*\n\s*\sDecrement\sthe\sreference\scount\sof\sthe\sResolvedCmdName\sstructure.\n\s*\sIf\sthere\sare\sno\smore\suses,\sfree\sthe\sResolvedCmdName\sstructure.\n\s*/\n\n\s\s\s\s\s\s\s\sresPtr->refCount--;\n\s\s\s\s\s\s\s\sif\s(resPtr->refCount\s==\s0)\s{\n\s\s\s\s\s\s\s\s\s\s\s\s/*\n\s\s\s\s\s*\sNow\sfree\sthe\scached\scommand,\sunless\sit\sis\sstill\sin\sits\n\s\s\s\s\s\s\s\s\s\s\s\s\s*\shash\stable\sor\sif\sthere\sare\sother\sreferences\sto\sit\n\s\s\s\s\s\s\s\s\s\s\s\s\s*\sfrom\sother\scmdName\sobjects.\n\s\s\s\s\s*/\n\n\s\s\s\s\s\s\s\s\s\s\s\sCommand\s*cmdPtr\s=\sresPtr->cmdPtr;\n\s\s\s\sif\s(cmdPtr\s!=\sNULL)\s{\s/*\sif\sadded\sby\sus\s*/\n\s\s\s\s\s\sTclCleanupCommand(cmdPtr);\n\s\s\s\s\s\sckfree((char\s*)\sresPtr);\n\s\s\s\s}/*\sif\sends\s*/\n\s\s\s\s\s\s\s\s}\n\s\s\s\s}\n}\n\nPatchFiles:\nSubmitted\sthe\scode\sof\sfunction:\n\n\s\s\s\sstatic\svoid\n\s\s\s\sFreeCmdNameInternalRep(objPtr)\n\s\s\s\s\s\s\s\sregister\sTcl_Obj\s*objPtr;/*\sCmdName\sobject\swith\sinternal\n\n\n\nCan't\sverify\sthis\swithout\shaving\sthe\scode\sthat\sleads\sto\sit.\nA\sdebugger\sdump\swould\sbe\smost\suseful.\s\sI\shave\scompiled\sTcl\non\sSol7/64\swith\sSunPro\s5.0\sand\srun\sthe\sfull\stests\ssuites\nwithout\sany\serrors.\s\sWhile\s64\sbits\sproblems\scould\sremain\sin\nthe\sTcl\score,\sit\sis\spossible\sthat\sthe\suser\shas\sone\sin\stheir\nown\sC\sextension.\s\n--\s01/26/2000\shobbs
J foundin obsolete:\s8.2.2
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 10.\sObjects
J title Crash\son\sSUN\s64\sbit\splatform\s(Sun5.7\sCompiler-\s5.0c++)
J type Bug
K 218317ffffffffffffffffffffffffffffffffff
U nobody
Z 39d9aa2f77b5403c70424af38fad5a99