Skip to content
Tcl Source Code Artifact [fa77e1dacc]
Login

Artifact [fa77e1dacc]

Artifact fa77e1dacc1b7bdf7279f1355e3b12f43a2634bc:

Ticket change [fa77e1dacc] - New ticket [219215ffffffffff|219215ffff] <i>Memory validation failure in Tcl_FindExecutable</i>. by nobody on 2000-10-26 05:03:41.
D 2000-10-26T05:03:41
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s3863\sBug\nVersion:\s8.2.2\nSubmitDate:\s'1999-12-13'\nLastModified:\s'2000-04-03'\nSeverity:\sMED\nStatus:\sAssigned\nSubmitter:\stechsupp\nChangedBy:\shobbs\nOS:\sSolaris\nOSVersion:\s2.6\nMachine:\sSparc\s5\nFixedDate:\s'2000-10-25'\nClosedDate:\s'2000-10-25'\n\n\nName:\sJohn\sR.\sJackson\n\nComments:\nA\sword\sof\sadvice\s(and\smaybe\sit\swill\ssave\syou\sall\sthe\stime\sit\stook\sme\sto\sfigure\sout\s:-):\sif\syou\srun\sthis\nunder\sgdb,\sit\smesses\swith\sargv[0]\sand\suses\sa\sfull\spath\swhich\sdoes\snot\strip\sthe\sbug.\sIn\sthat\scase,\ntweak\sthe\stest\scase\sto\spass\san\sexplicit\svalue,\se.g.\s"./bug".\n\nReproducibleScript:\nRun\sthe\sfollowing\sexample\s**exactly**\slike\sthis\sagainst\sTcl\sbuilt\swith\sTCL_MEM_DEBUG:\n\n\s\s./a.out\s/\n\n#include\s<unistd.h>\n#include\s<tcl.h>\n\nint\nmain\s(argc,\sargv)\n\s\s\s\s\s\s\s\sint\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sargc;\n\s\s\s\s\s\s\s\schar\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s**argv;\n{\n\s\s\s\s\s\s\s\sif\s(argc\s>\s1)\s{\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s(void)\schdir(argv[1]);\n\s\s\s\s\s\s\s\s}\n\s\s\s\s\s\s\s\sTcl_FindExecutable(argv[0]);\n\s\s\s\s\s\s\s\sreturn\s0;\n}\n\nIf\sthe\sprogram\sis\scalled\swithout\sthe\s./\sit\sworks.\nIf\sthe\sprogram\sis\scalled\swithout\sarguments\s(so\sit\sdoes\snot\schdir),\sit\sworks.\nIf\sthe\sprogram\sis\scalled\swith\san\sargument\sother\sthan\s/opt\s(e.g.\s/foozle),\sit\sworks.\n\nObservedBehavior:\nlow\sguard\sbyte\s4\sis\s0xef\s\s\s\s\s\s\s\s\s\nlow\sguard\sbyte\s5\sis\s0xff\s\s\s\s\s\s\s\s\s\nlow\sguard\sbyte\s6\sis\s0xe7\s\s\s\s\s\s\s\s\s\nlow\sguard\sbyte\s7\sis\s0xe0\s\s\s\s\s\s\s\s\s\ntotal\smallocs\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s34\ntotal\sfrees\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s1\ncurrent\spackets\sallocated\s\s\s\s\s\s\s\s\s33\ncurrent\sbytes\sallocated\s\s\s\s\s\s\s\s\s1483\nmaximum\spackets\sallocated\s\s\s\s\s\s\s\s\s33\nmaximum\sbytes\sallocated\s\s\s\s\s\s\s\s\s1483\nlow\sguard\sfailed\sat\s230d0,\s./../unix/tclUnixInit.c\s327\n20\sbytes\sallocated\sat\s(./../generic/tclFileName.c\s381)\nMemory\svalidation\sfailure\nAbort\n\nDesiredBehavior:\nMy\sapplication\stries\sto\scd\sto\sa\s"safe"\splace\sas\ssoon\sas\spossible\sto\sprotect\sany\score\sfiles\sthat\sare\ngenerated\s(not\sthat\smy\scode\swould\sever\sdo\sthat,\sof\scourse\s:-),\sand\sthis\swas\sdone\sbefore\sthe\sTcl_FindExecutable\scall.\sAfter\sreading\sthe\sman\spage\sagain\sand\sstepping\sthrough\sthe\scode\sto\stry\nand\sfind\sthe\sproblem\s(but\sI\sgot\stired\sand\sgave\sup),\sI\scan\ssee\sthat\sI\sshould\sprobably\scall\sTcl_FindExecutable\simmediately\son\sentry,\swhich\sis\sOK.\sBut\sthere\sis\sstill\spretty\sclearly\ssomething\nwrong\sin\sthe\sguts\sof\sthis\sthing\s--\sit\sshouldn't\strip\sa\smemory\sfault.\n\n\n\nVerified\swith\s8.3.0.\s\sYou\scan\swork-around\sit\swith:\n\n\s\s\s\s\s\s\s\sif\s(argc\s>\s1)\s{\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s(void)\schdir(argv[1]);\n\s\s\s\s\s\s\s\s\s\sTcl_FindExecutable(argv[1]);\n\s\s\s\s\s\s\s\s}\selse\s{\n\s\s\s\s\s\s\s\s\s\sTcl_FindExecutable(argv[0]);\n\s\s\s\s\s\s\s\s}\n\s\s\s\s\s\s\s\sreturn\s0;\n\nOr\sdoing\sthe\sFindExecutable\sfirst.\s\n--\s04/03/2000\shobbs
J foundin obsolete:\s8.2.2
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 69.\sOther
J title Memory\svalidation\sfailure\sin\sTcl_FindExecutable
J type Bug
K 219215ffffffffffffffffffffffffffffffffff
U nobody
Z ce6708f9c3950cd31e8c31be8cd13eba