Skip to content
Tcl Source Code Artifact [36a40fef7b]
Login

Artifact [36a40fef7b]

Artifact 36a40fef7b72000443af7ffac1789aad5e806b65:

Ticket change [36a40fef7b] - New ticket [218979ffffffffff|218979ffff] <i>improper use of catch command crashes the interpreter</i>. by nobody on 2000-10-26 01:08:53.
D 2000-10-26T01:08:53
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s3412\sBug\nVersion:\s8.2\nSubmitDate:\s'1999-11-05'\nLastModified:\s'2000-01-20'\nSeverity:\sCRIT\nStatus:\sReleased\nSubmitter:\stechsupp\nChangedBy:\shobbs\nOS:\sWindows\sNT\nOSVersion:\s4.0\s/\sSP4\nFixedDate:\s'2000-01-20'\nFixedInVersion:\s8.3\nClosedDate:\s'2000-10-25'\n\n\nName:\nBorivoj\sTydlitat\n\nReproducibleScript:\n//d>\stclsh\s(or\stclshd)\n\s\s\s\s%\sproc\sfoo\s{args}\s{\n\s\s\s\s\s\sforeach\sv\s$args\s{\n\s\s\s\s\s\s\s\supvar\s$v\svar\n\s\s\s\s\s\s\s\s\s\s\s\sputs\s"variable\s$v\sexistence:\s[info\sexists\svar]"\n\s\s\s\s\s\s}\n\s\s\s\s}\n\s\s\s\s%\sfoo\sa\n\s\s\s\svariable\sa\sexistence:\s0\n\s\s\s\s%\scatch\s[info\sbody\sfoo]\n\nObservedBehavior:\ncoredumps\s(crashes)\son\sNT\s4.0,\sreading\sNULL\spage\n\s\s\s\scorrectly\sreturns\s1\son\sAIX\s4.2\s(NULL\spage\sis\sreadable\son\sAIX\swithout\n\s\s\s\sgenerating\san\sexception)\n\n\n\nVerified\son\sLinux\swith\s8.3b2.\sMinimal\scase\sseems\sto\sbe:\n\n--------------------------------------------\n\nproc\sfoo\s{}\s{set\sa\s1}\nfoo\ncatch\s[info\sbody\sfoo]\n\n--------------------------------------------\n\nIn\sother\swords,\sa\sproc\swith\sa\slocal\svariable\sis\senough\sto\sdo\sit.\s\sThe\sproc\smust\sbe\scompiled\sbefore\sthe\scatch.\s\sPerhaps\sthe\scompiler\sis\sdoing\ssomething\suncouth\swith\scompiledLocals?\n\n-\seric\n\n--\s01/17/2000\sericm\n\nThe\sreal\sproblem\slies\sin\sthat\scatch\sshould\snever\suse\sanother's\nbyte\scode,\swhich\sis\sthe\scase\shere.\s\sTake\sthe\sfollowing\sexample:\n\nproc\sfoo\sa\s{\sset\sb\s$a\s}\nfoo\s1\nproc\sbar\s{}\s{\sset\sc\s4;\sset\sd\s3;\sset\sa\s2;\scatch\s[info\sbody\sfoo]\s;\sset\sd\s}\nbar\nreturns\s=>\s4\n\nIn\sfoo,\sthe\sindexed\scompiled\slocals\sa\s1:a\sand\s2:b.\s\sWhat\sthe\scatch\nabove\swill\sdo\sis\sget\sthe\svalue\sof\slocal\s1\sin\sbar\sand\sset\slocal\s2\sto\sit\n(d\sgets\sc\sin\sthis\scase).\s\n--\s01/17/2000\shobbs\nWell,\sthere\swere\stwo\sways\sto\sgo\sabout\ssolving\sthis,\sand\swe\sdecided\non\swhat\smight\snot\sbe\sthe\smost\s"correct"\spath,\sbut\sone\sthat\sshould\nwork\s100%.\s\sIt\sseems\sthat\sthe\sonly\spossible\sway\sto\scause\sthe\sabove\noffensive\sbytecode\suse\sis\sthrough\sthe\suse\sof\s[info\sbody].\s\sThus,\nwe\schanged\s[info\sbody]\sto\salways\sreturn\sa\sstring.\n\nThe\ssecond,\s"correct"\ssolution\srequires\sadding\sseveral\sextra\schecks\nto\sTcl_EvalObjEx,\schecking\sthat\sthe\sbytecode\swe\sare\sabout\sto\suse\sis\nactually\sbeing\sused\sin\sthe\scorrect\sproc\scontext.\s\sI've\sleft\sthat\ncode\sthere,\s#def'd\sout,\sso\sthat\swe\shave\sit\sfor\sreference\sshould\sit\ncome\sto\spass\sthat\sthe\sabove\sassumption\s(that\s[info\sbody]\sis\sthe\sonly\nthing\sthat\scan\scause\sthis\sto\spass)\sis\sfalse.\s\n--\s01/20/2000\shobbs\n\n
J foundin obsolete:\s8.2
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 10.\sObjects
J title improper\suse\sof\scatch\scommand\scrashes\sthe\sinterpreter
J type Bug
K 218979ffffffffffffffffffffffffffffffffff
U nobody
Z b2fda951e8a69633f0cd0c15dd3bdd2f