Skip to content
Tcl Source Code Artifact [27dbf1318d]
Login

Artifact [27dbf1318d]

Artifact 27dbf1318d2cbe744c2c85a68acfe5d8b256be42:

Ticket change [27dbf1318d] - New ticket [2888044fffffffff|2888044fff] <i>TclCleanupLiteralTable segmentation fault</i>. by andreas_kupries on 2009-10-28 16:01:53.
D 2009-10-28T16:01:53
J assignee hobbs
J cmimetype text/plain
J comment NEW\s_________________________________________________________________________________________\n\nRunning\sthe\stcllib\stestsuite\sI\sfind\sthat\sthe\stests\sof\sthe\sncgi\spackage\scrash\sin\sthe\svery\ssame\ssame\splace,\swith\san\sidentical\sstacktrace,\swhen\srun\sby\sTcl\s8.6\shead.\sBased\son\sthe\scontents\sof\sthe\sstructures\sI\sam\svery\ssure\sthat\sthis\sis\sthe\ssame\sproblem\sas\sshown\sby\sTcl's\stestsuite,\sdescribed\sbelow.\n\nMail\s1\s_______________________________________________\nWhile\sevaluating\sa\spatch\sto\savoid\scalling\schannel\soutputproc\swith\s0-length\swrites\sI\scame\sacross\sa\scrash\sin\sthe\sTcl\s8.6\shead\stestsuite,\swhich\sI\shave\snow\sconfirmed\sto\shappen\sin\sthe\sunpatched\score.\n\nContext:\n\s\s\s\sPlatform\sis\slinux-ix86\s(32bit).\n\s\s\s\sThe\score\swas\sbuilt\susing\s--enable-symbols=all\n\s\s\s\s(and\sinstalled\sin\ssome\sside\sdirectory)\n\nThe\stestsuite\swas\srun\susing\n\n\s\s\s\smake\stest\sTESTFLAGS='-verbose\sbpste\s-singleproc\s1'\s\\\n\s\s\s\s\s\s\s\s2>&1\s|\stee\sLOG\n\nThe\s-singleproc\s1\sis\simportant.\n\nNote:\sOn\smy\splatform\sthe\s--enable-symbols=all\smeans\sthat\sloading\sand\scompiling\sthe\s2MB\sclock.test\sfile\stook\saround\s15\sminutes,\sduring\swhich\sno\soutput\shappens.\sThe\stest\sis\s__not__\shung.\sJust\sbe\spatient.\n\nThe\stest\ssuite\scrashes\safter\shttpdold\shas\scompleted,\ssee\slog\sexcerpt:\n\n\s\s\s\s----\shttpold-5.1\sstart\n\s\s\s\s++++\shttpold-5.1\sPASSED\n\s\s\s\s----\shttpold-5.2\sstart\n\s\s\s\s++++\shttpold-5.2\sPASSED\n\s\s\s\s----\shttpold-5.3\sstart\n\s\s\s\s++++\shttpold-5.3\sPASSED\n\s\s\s\s----\shttpold-6.1\sstart\n\s\s\s\s++++\shttpold-6.1\sPASSED\n\s\s\s\shttpold.test:\s\s\sTotal\s\s\s31\s\s\sPassed\s\s31\s\s\sSkipped\s0\s\s\s\sFailed\s\s0\n\s\s\s\smake:\s***\s[test-tcl]\sSegmentation\sfault\s(core\sdumped)\n\nThe\sstacktrace\sin\sthe\score\sshows\sthat\sthe\scrash\shappens\sin\n\n#0\s\s0x400e4ecd\sin\sTclCleanupLiteralTable\s(interp=0x9ea73e8,\stablePtr=0x9ea74b4)\sat\s/home/andreask/workbench/ZeroWrite/src/tcl86base/generic/tclLiteral.c:131\n#1\s\s0x400409cc\sin\sDeleteInterpProc\s(interp=0x9ea73e8)\sat\s/home/andreask/workbench/ZeroWrite/src/tcl86base/generic/tclBasic.c:1392\n#2\s\s0x4010313b\sin\sTcl_EventuallyFree\s(clientData=0x9ea73e8,\sfreeProc=0x40040829\s<DeleteInterpProc>)\n\s\s\s\sat\s/home/andreask/workbench/ZeroWrite/src/tcl86base/generic/tclPreserve.c:299\n#3\s\s0x40040821\sin\sTcl_DeleteInterp\s(interp=0x9ea73e8)\sat\s/home/andreask/workbench/ZeroWrite/src/tcl86base/generic/tclBasic.c:1284\n#4\s\s0x400c7e2c\sin\sSlaveObjCmdDeleteProc\s(clientData=0x9ea73e8)\sat\s/home/andreask/workbench/ZeroWrite/src/tcl86base/generic/tclInterp.c:2581\n#5\s\s0x40042488\sin\sTcl_DeleteCommandFromToken\s(interp=0x8064d78,\scmd=0x820f830)\sat\s/home/andreask/workbench/ZeroWrite/src/tcl86base/generic/tclBasic.c:2984\n#6\s\s0x400c5096\sin\sTcl_InterpObjCmd\s(clientData=0x0,\sinterp=0x8064d78,\sobjc=3,\sobjv=0x80669a8)\n\n\nThe\sbug\sis\sin\sTclCleanupLiteralTable\sitself\sI\sbelieve.\sAccording\sto\sthe\scomments\n\n\s\s\s\s\s\s\s\s\s\s*\sThe\sproblem\sis\sthat\sfreeing\sa\sliteral's\sinternal\srepresentation\scan\n\s\s\s\s\s\s\s\s\s\s*\sdelete\sother\sliterals\sto\swhich\sit\srefers,\smaking\snextPtr\sinvalid.\n\s\s\s\s\s\s\s\s\s\s*\sSo\seach\stime\swe\sfree\san\sinternal\srep,\swe\sstart\sits\sbucket\sover\n\s\s\s\s\s\s\s\s\s\s*\sagain.\n\s\s\s\s\s\s\s\s\s\s*/\n\nLooking\sat\sthe\scode,\showever\sthe\s"we\sstart\sits\sbucket\sover\sagain"\sdoes\s__not__\shappen.\sThere\sis\sthe\sdidOne\sflag,\swhich\sis\sset,\sbut\sthen\sthe\sinner\sloop\sis\snot\saborted.\sIt\sis\sactually\srun\sa\ssecond\stime\sfor\sthe\ssame\svalue\sof\sentryPtr,\sand\sdue\sto\sobjPtr->type\snow\sset\sto\sNULL\sit\sruns\sthe\sskip\sbranch\sof\sthe\sif,\sand\sthen\scontinues\son\sto\straverse\sthe\sbucket\schain\sfrom\sthe\scurrent\spoint.\sNo\sreset\sat\sall.\n\nIn\sour\scrash\sit\sis\s(according\sto\smy\sinvestigations)\sthe\scurrent\sentryPtr\swhich\sactually\sgets\srecursively\sdeleted\s((*)\s=\sremoved\sfrom\sthe\schain),\sand\sthen\sthe\ssecond\siteration\son\sthis\ssame\sentryPtr\scrashes\strying\sto\sget\sthe\stypePtr\sfor\san\sobjPtr\swhich\sis\sfreed\sand\slocated\sin\sa\sfreed\sLiteralEntry\sstructure\s(Everything\sis\s0x61616161).\n\nA\spossible\sred-herring,\sthe\stype\sof\sthe\sobjPtr\sin\squestion\swas\s'substcode'.\n\nMy\sfirst\sattempt\sat\sfixing\sthis\sby\sadding\sa\s'break;'\sjust\safter\s'didOne\s=\s1;',\sto\sactually\sreset\sthe\sloop\sand\srestart\sit\sfrom\sthe\sbeginning\scaused\s17\stests\sto\sfail.\sIt\sis\sactually\sunclear\sif\sthat\shappens\sbecause\n(a)\snow\ssome\sliterals\sare\sactually\sreleased,\sor,\sconversely,\n(b)\sif\ssome\sliterals\sare\snot\sreleased\sanymore.\sOr\n(c)\sif\sthese\stests\swould\seven\sfail\swithout\smy\spatch,\sbut\sare\sjust\sprevented\sfrom\sbeing\sreached\sby\sthe\scrash\s(they\sare\sall\sin\sinterp.test,\safter\shttp*.test).\n\nSo,\saccording\sto\sannotate\sthe\slast\schanges\sin\sthis\sarea\swere\sby\sdgp\s(rev\s1.20)\sand\sdkf\s(rev\s1.25,\s1.34)\sand\sI\shope\syou\scan\sshed\ssome\smore\slight\son\sthis.\sThe\swhole\sarea\swas\ssurrounded\sby\skbk\s(rev\s1.19),\sso\sI\sadded\syou\sas\swell\sto\sthis\smail.\n\nAh,\syes.\sThis\scrash\sdoesn't\shappen\sfor\s8.4\snor\s8.5\sbranches.\n\n\nNext\ssteps\shere\s...\sSee\sif\sit\scrashes\sfor\sregular\sbuild\sas\swell\s(no\senable-symbols,\s(x)),\sand\sif\syes,\stry\sto\sbisect\sit.\n\n(*)\sfreeIntRepProc\sis\scalled,\sand\sTclReleaseLiteral\sis\scalled\srecursively\son\sthe\ssame\sobjPtr,\srefCount\sgoes\szero,\swhich\salso\sremoves\sthe\sLiteralEntry\sfrom\sthe\schain.\n\n(x)\sHoping\sso\sbecause\sthen\sclock.test\sshould\snot\stake\ssuch\seffing\slong\stime.\s\n\nMail\s2\s_____________________________________________________\n\n>\sNext\ssteps\shere\s...\sSee\sif\sit\scrashes\sfor\sregular\sbuild\sas\swell\s(no\senable-symbols,\s(x)),\n\nYes.\sIt\sdoes.\n\n>\sand\sif\syes,\stry\sto\sbisect\sit.\n\nBisecting\stells\sus\sthat\sthe\scrash\swas\sintroduced\sbetween\n2009-09-11\sand\s2009-09-12.\n\nFrom\sthe\sChangelog.\n\n---\stcl-20090911/ChangeLog\s\s\s\s\s\s2009-09-10\s14:20:00.000000000\s-0700\n+++\stcl-20090912/ChangeLog\s\s\s\s\s\s2009-09-11\s13:13:27.000000000\s-0700\n@@\s-1,3\s+1,18\s@@\n+2009-09-11\s\sDon\sPorter\s\s<[email protected]>\n+\n+\s\s\s\s\s\s\s*\sgeneric/tclBasic.c:\s\s\sCompleted\sthe\sNR-enabling\sof\s[subst].\n+\s\s\s\s\s\s\s*\sgeneric/tclCmdMZ.c:\s\s\s[Bug\s2314561].\n+\s\s\s\s\s\s\s*\sgeneric/tclCompCmds.c:\n+\s\s\s\s\s\s\s*\sgeneric/tclCompile.c:\n+\s\s\s\s\s\s\s*\sgeneric/tclInt.h:\n+\s\s\s\s\s\s\s*\stests/coroutine.test:\n+\s\s\s\s\s\s\s*\stests/parse.test:\n+\n+2009-09-11\s\sDonal\sK.\sFellows\s\s<[email protected]>\n+\n+\s\s\s\s\s\s\s*\stests/http.test:\sAdded\sin\scleaning\sup\sof\shttp\stokens\sfor\seach\stest\n+\s\s\s\s\s\s\sto\sreduce\samount\sof\sglobal-variable\spollution.\n+\n\nThis\sis\seither\sa\sproblem\swith\sFreeSubstCodeInternalRep,\sor\sthis\sfunction\ssimply\sexposes\sthe\sfact\sthat\sa\sbug\sin\sTclCleanupLiteral\swas\snot\sas\sfixed\sas\spreviously\sthought/believed.\sLooking\sat\sFSCIR\sit\slooks\sgood,\sand\sI\sbelieve\sit\sis\sthe\slatter.\n\nWhat\shappens,\sI\sguess,\sis:\sCleanupLiteral\stable\sfrees\sthe\ssubstcode\sintrep,\swhich\sfrees\sthe\sBytecode\s(TclCleanupByteCode),\swhich\srefers\sback\sto\sthe\swhole\sliteral\sstring,\sand\sTclReleaseLiteral's\sit,\swhich\sremoves\sit\sfrom\sthe\sbucket\schain,\sand\snow\sthe\snext\siteration\sworks\swith\sthe\sfreed\sliteral\sentry,\sbang.\nExcept\sper\sthe\scomments\sit\sshould\shave\srestarted\sthe\sloop\sfrom\sthe\sbeginning.\n
J foundin None
J is_private 0
J priority 8
J resolution None
J status Open
J submitter andreas_kupries
J subsystem 41.\sMemory\sAllocation
J title TclCleanupLiteralTable\ssegmentation\sfault
J type Bug
K 2888044fffffffffffffffffffffffffffffffff
U andreas_kupries
Z c8f34893783a2c7620e09e0c4b07f24a