.
D 2000-10-26T00:56:33
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s4058\sBug\nVersion:\s8.2.3\nSubmitDate:\s'2000-01-21'\nLastModified:\s'2000-03-06'\nSeverity:\sMED\nStatus:\sClosed\nSubmitter:\stechsupp\nChangedBy:\shobbs\nOS:\sLinux-Red\sHat\nOSVersion:\sRedHat\sLinux\s5.2,\sKernel\s2.0.36\nMachine:\sPentium,\sPentium\sII\nFixedDate:\s'2000-10-25'\nClosedDate:\s'2000-03-06'\n\n\nName:\n\nUsman\sMuzaffar\n\n\nExtensions:\n\nno\sextensions,\sTcl\s8.2.3\s(and\s8.0.3)\sout\sof\sthe\sbox\n\n\nCustomShell:\n\nno\smodifications\n\n\nComments:\n\nI\sfound\sthis\swhile\strying\sto\swrite\sa\scatch\sphrase\sthat\sreformats\n\nthe\scontents\sof\serrorInfo.\sI\ssimply\sneeded\saccess\sto\sthe\sstack\sat\n\nthe\stime\sof\serror.\serrorInfo\sof\scourse\sseemed\sideal,\sbut\sI\skept\snoticing\n\nduplicate\sentries.\n\n\nReproducibleScript:\n\nThe\sproblem\sis\ssimply\sthat\sif\sa\sfunction\sfoo\scontains\san\serror,\sthe\n\nerrorInfo\sstack\sstrace\sfrom\swill\sincorrectly\slist\s'foo'\sTWICE,\sif\sboth\n\nof\sthe\sfollowing\sconditions\sare\strue:\n\n1.\sfoo\sis\sautomatically\ssourced\n\n2.\sfoo\sis\spassed\sarguments\sthat\sextend\sover\smultiple\sline\n\n\nTwo\sfiles\sare\sneeded\sto\sshow\sthe\sproblems:\n\n\nproc2.tcl:::::::::::::::::\n\nproc\sproc2\s{x}\s{\n\n\s\s\s\serror\s"proc2\serror"\n\n}\n\n\nmain.tcl:::::::::::::::::::\n\nset\sauto_index(proc2)\s{source\s./proc2.tcl}\n\nproc\sproc1\s{x}\s{\n\n\s\s\s\serror\s"proc1\serror"\n\n}\n\n\nproc\smain\s{}\s{\n\n\s\s\s\sproc2\s{\n\nbogus\n\n\s\s\s\s}\n\n}\n\nmain\n\n\nRun\sprogram\s::::::::::::::::\n\n%\stclsh\smain.tcl\n\n\nObservedBehavior:\n\nThis\sis\swhat\syou\sget\swhen\syou\srun\smain.tcl.\n\nNotice\sthat\sproc2\sis\slisted\sin\sthe\sstack\strace\sTWICE.\n\n\nproc2\serror\n\n\s\s\s\swhile\sexecuting\n\n"error\s"proc2\serror""\n\n\s\s\s\s(procedure\s"proc2"\sline\s2)\n\n\s\s\s\sinvoked\sfrom\swithin\n\n"proc2\s{\n\n\s\s\s\sinvoked\sfrom\swithin\n\n"proc2\s{\n\nbogus\n\n\s\s\s\s}"\n\n\s\s\s\s(procedure\s"main"\sline\s2)\n\n\s\s\s\sinvoked\sfrom\swithin\n\n"main"\n\n\s\s\s\s(file\s"main.tcl"\sline\s11)\n\n\nDesiredBehavior:\n\nWhat\sI\sexpect\sis\sto\ssee\sproc2\slisted\sonly\sonce.\sIn\smain.tcl\schange\n\nthe\scall\s'proc2'\sto\s'proc1'\sin\sthe\sprocedure\s'main'.\sproc1\sis\sidentical\n\nto\sproc2,\sbut\sit's\snot\sdynamically\sloaded.\sThis\stime\syou\sget:\n\n\nproc1\serror\n\n\s\s\s\swhile\sexecuting\n\n"error\s"proc1\serror""\n\n\s\s\s\s(procedure\s"proc1"\sline\s2)\n\n\s\s\s\sinvoked\sfrom\swithin\n\n"proc1\s{\n\nbogus\n\n\s\s\s\s}"\n\n\s\s\s\s(procedure\s"main"\sline\s2)\n\n\s\s\s\sinvoked\sfrom\swithin\n\n"main"\n\n\s\s\s\s(file\s"main.tcl"\sline\s11)\n\n\nNote\sthat\sproc1\sis\sonly\son\sthe\sstack\sonce.\sInterestingly,\sif\syou\scall\sproc2\n\n(the\sdynamic\sproc),\sbut\sdon't\sinclude\sthe\snewlines\saround\sit's\sargument,\n\nyou\salso\sget\sa\scorrect\serrorInfo.\s\n\n\nDelete\sthe\snewlines\saround\sthe\sword\s'bogus',\sso\sthat\sthe\sbody\sof\s'main'\n\nlooks\slike\sthis:\n\n\s\s\sproc2\s{bogus\s\s\s\s}\n\n\nNow\srun:proc2\serror\n\n\s\s\s\swhile\sexecuting\n\n"error\s"proc2\serror""\n\n\s\s\s\s(procedure\s"proc2"\sline\s2)\n\n\s\s\s\sinvoked\sfrom\swithin\n\n"proc2\s{bogus\s\s\s\s}"\n\n\s\s\s\s(procedure\s"main"\sline\s2)\n\n\s\s\s\sinvoked\sfrom\swithin\n\n"main"\n\n\s\s\s\s(file\s"main.tcl"\sline\s9)\n\n\nWhich\sis\swhat\sI'd\sexpect.\sSo\sit\swould\sseem\sthat\sboth\sthe\sconditions\slisted\sabove\n\nmust\sbe\strue:\s1)\sthe\sproc\smust\sbe\sdynamically\sloaded\sand\s2)\sit\smust\sbe\n\ncalled\swith\sargs\sthat\sspan\snewlines.\n\n\n\n\nFor\serror\scases,\sit\sis\sarguable\swhether\sthe\serrorInfo\sshould\sinclude\ndata\sthat\sindicates\suse\sof\sunknown.\s\sThis\shas\sbeen\sthe\sway\sin\sthe\spast,\nand\swe're\sgoing\sto\sleave\sit\sthat\sway\s(it\sdoes\safter\sall\sindicate\sa\ndifferent\spath\staken,\swhich\sis\sthe\scase).\s\sThe\sspanning\sof\snewlines\nis\sa\sred\sherring,\sbecause\sfor\sthat\sline\sonly\sthe\sfirst\sline\sof\sthe\ncalling\sproc\sis\sincluded\s(errorInfo\sdoesn't\snot\scontain\sall\sinfo).\s\n--\s03/06/2000\shobbs
J foundin final:\s8.2.3
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 69.\sOther
J title errorInfo\shas\sduplicate\sstack\sentries\sfor\sautoloaded\sprocs
J type Bug
K 218347ffffffffffffffffffffffffffffffffff
U nobody
Z dac68c44a282225521b615133d98921b