Skip to content
Tcl Source Code Artifact [e8092ab3fe]
Login

Artifact [e8092ab3fe]

Artifact e8092ab3fe378fd49fcc4d7ff1008900706a2583:

Ticket change [e8092ab3fe] - Ticket [1658572fffffffff|1658572fff] <i>Heap corruption in interp.test</i> status still Open with 4 other changes by twylite on 2007-03-15 23:19:56.
D 2007-03-15T23:19:56
J icomment Logged\sIn:\sYES\s\nuser_id=91629\nOriginator:\sNO\n\nJust\sexperienced\sthis\sbug\smyself\s:(\nI'm\sbuilding\swith\sVisual\sStudio\s2005\sExpress,\sbut\sI've\salso\sreproduced\sit\swith\sVisual\sStudio\s6\sPro.\s\sOperating\ssystem\sis\sWindows\s2000\sProfessional.\n\nBuild:\nSources\sfrom\sCVS\snightly\s2007/03/08,\sand\sstraight\sfrom\sCVS\stoday\s(2007/03/15).\nnmake\s/nologo\s/f\smakefile.vc\srelease\sOPTS=symbols,threads\nnmake\s/nologo\s/f\smakefile.vc\stest\sOPTS=symbols,threads\n\nTest:\nWhile\srunning\sinterp.test,\stcltest.exe\scrashes\s(Access\sViolation\serror).\n\nAnalysis:\nThe\sproblem\sis\sNOT\sin\s2.13.\s\sIt\sis\sin\sthe\sforeach\s+\sinterp\sdelete\sloop\sdirectly\safter\s2.13.\n\nThe\scrash\soccurs\sin\sTcl_PopCallFrame()\sin\stclnamesp.c,\sline\s473:\snsPtr->activationCount--;\nAt\sthis\spoint\snsPtr\shas\sthe\svalue\s0x009ae728\s(more\son\sthat\slater).\n\nThe\ssmallest\scode\ssnippet\sthat\scan\sreproduce\sthis\sis:\n---\ninterp\screate\ninterp\screate\ninterp\screate\ninterp\screate\ninterp\sslaves\n#\s-->\sinterp2\sinterp3\sinterp0\sinterp1\ninterp\sdelete\sinterp2\ninterp\sdelete\sinterp3\n---\n\nNow,\sdeleting\sthe\sinterps\sin\sanything\sbut\sthat\sorder\sdoes\snot\sproduce\sthe\sbug.\s\sI've\stried\severy\snumber\sof\sinterps\sup\sto\sand\sincluding\s4,\sand\severy\sorder\sof\sdeleting\sinterps\s--\sthat's\sa\sLOT\sof\scombinations\s:(\s\n\nFollowing\sthe\scall\schain\sdown\sfrom\sthe\s"interp\sdelete\sinterp3":\n\s\sTcl_InterpObjCmd\scalls\n\s\sTcl_DeleteCommandFromToken\swhich\sinvokes\s(*cmdPtr->deleteProc)(cmdPtr->deleteData)\swhich\sis\n\s\sSlaveObjCmdDeleteProc\swhich\scalls\n\s\sTcl_DeleteInterp\swhich\scalls\n\s\sTcl_EventuallyFree\swhich\sinvokes\s(*freeProc)((char\s*)clientData)\swhich\sis\n\s\sDeleteInterpProc\swhich\scalls\n\s\sTclTeardownNamespace\s...\n\s\s...\swhich\soverwrites\smemory\sat\s0x009ae728\s(and\sother\slocations)\n\nDigging\sdeeper\sstill\s...\n\s\sTclTeardownNamespace\scalls\n\s\sTclDeleteNamespaceVars\swhich\sinvokes\n\s\sckfree((char\s*)\svarPtr)\s...\n\s\s...\swhich\sappears\sto\scorrupt\s3\sbytes\sat\s0x009ae728\n\nThe\svarPtr\sis\sno-where\snear\s0x009ae728,\snor\s(so\sfar\sas\sI\scan\stell)\sis\sany\sinformation\scontained\sin\sthe\svarPtr\sstruct.\n\nThere\sare\sslightly\sdifferences\sin\sthe\scorruption\severy\stime\sI\slook\sa\slittle\sdeeper\sdown\sthe\sstack\s--\sI\sassume\sthis\smay\shave\ssomething\sto\sdo\swith\sthe\sdebugger\shaving\sinformation\sin\sthe\sstack\sframe.\n\nIn\sany\sevent,\sfrom\s1\sto\s4\sbytes\sof\smemory\sat\s0x009ae728\sget\scorrupted\severy\stime,\sto\sseemingly\sarbitrary\svalues.\n\nNow\sI'm\safraid\sI'm\snot\sfamiliar\swith\sthe\sTcl\score,\sso\sthe\svarious\sstructs\shere\sare\smeaningless\sto\sme.\s\sAlso\smy\sfindings\sdon't\sagree\swith\smistachkin's\sconclusion\sabout\sTcl_UnsetVar\scalled\sfrom\sTcl_MakeSafe.\n\nBut\sI'm\sgoing\sto\sgo\son\sa\slimb\shere\sand\shazzard\sa\sguess:\nThis\sbug\sonly\soccurs\swith\sat\sleast\s4\sinterps,\sand\sonly\swhen\syou\sdelete\sthe\s1st\sin\sthe\slist\sreturned\sby\s[interp\sslaves]\sfollowed\sby\sthe\ssecond.\s\sThat\slist\sis\snot\sordered;\srather\sit\slooks\sto\sme\slike\sthe\sinterp\snames\sare\skept\sin\ssome\ssort\sof\stree\sthat\sis\sflattened\sby\s[interp\sslaves].\s\sIs\sthis\spossibly\ssome\ssort\sof\sbug\swith\sdeleting\snodes\sfrom\sa\stree,\sand\smore\sspecifically\swhen\sdeleting\svariable\snames\sfrom\sthe\snamespace's\svariable\stable?\n\n
J login twylite
J mimetype text/plain
J username twylite
K 1658572fffffffffffffffffffffffffffffffff
U twylite
Z 0509cac7cda6a603d44fda60fba6a29e