Skip to content
Tcl Source Code Artifact [bb33c9e14c]
Login

Artifact [bb33c9e14c]

Artifact bb33c9e14cefd5d7fa7daed69f70784ec7cd022b:

Ticket change [bb33c9e14c] - New ticket [219113ffffffffff|219113ffff] <i>While in a trace-proc, traces are not disabled for TCL_TRACE</i>. by nobody on 2000-10-26 01:10:59.
D 2000-10-26T01:10:59
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s6049\sBug\nVersion:\s8.3\nSubmitDate:\s'2000-07-25'\nLastModified:\s'2000-07-25'\nSeverity:\sMED\nStatus:\sReleased\nSubmitter:\stechsupp\nChangedBy:\sericm\nOS:\sAll\nFixedDate:\s'2000-07-25'\nFixedInVersion:\s8.4a2\nClosedDate:\s'2000-10-25'\n\n\nName:\nStefan\sVogel\n\nExtensions:\nNone\n\nCustomShell:\nNone\n\nReproducibleScript:\nI've\screated\sa\strace-callback-function\s"VariableProc"\sand\sregistered\sa\strace\non\san\sarray\swith\sTcl_TraceVar2.\nThan\sthe\scallback\sis\sinvoked\swith\sa\scall\sto\se.g.\s"array\snames\s...".\nIn\sthe\scallback-function\sthe\sarray-variable\sis\sassigned\sa\snew\svalue.\nThis\scauses\sanother\sWrite-Trace.\n\nHere\sis\ssome\scode\s(for\sWindows?):\n\n#include\s<tcl.h>\n\nstatic\schar*\nVariableProc(clientData,\sinterp,\spart1,\spart2,\sflags)\n\sClientData\sclientData;\n\sTcl_Interp*\sinterp;\n\schar\s*part1,\s*part2;\n\sint\sflags;\n{\n\s\sif\s(flags\s&\sTCL_TRACE_WRITES)\s{\nprintf("--Traced\swrite\son\s%s(%s)\\n",\spart1,\spart2);\n\s\s}\selse\sif\s(flags\s&\sTCL_TRACE_ARRAY)\s{\nprintf("--Traced\sarray\son\sarray\s%s(%s)\\n\sNow\ssetting\ststkey\s=\ststvalue.\\n\sThis\swill\sincorrectly\scall\sVariableProc\swith\sTCL_TRACE_WRITES\\n",\spart1,\spart2);\n/*\sTcl_GetVar2\sbehaves\scorrectly\s*/\nTcl_SetVar2(interp,\spart1,\s"tstkey",\s"tstvalue",\s0);\nprintf("tstkey\sis\sset\sto\ststvalue\\n");\n\s\s}\n\s\sreturn\sNULL;\n}\n\n__declspec(dllexport)\sint\sArray_test_Init(interp)\n\sTcl_Interp*\sinterp;\n{\n\s\sif\s(Tcl_InitStubs(interp,\s"8.3",\s0)\s==\sNULL)\s{\nreturn\sTCL_ERROR;\n\s\s}\n\s\sTcl_PkgProvide(interp,\s"Array_test",\s"0.1");\n\n\s\s/*\sSet\san\sinitial\svalue\sto\sarray\s'foobar'\s*/\n\s\sTcl_SetVar2(interp,\s"foobar",\s"hello",\s"one",\sTCL_LEAVE_ERR_MSG);\n\s\s/*\sPut\sthe\strace\son\s'foobar'\s*/\n\s\sTcl_TraceVar2(interp,\s"foobar",\s(char*)NULL,\s\n(TCL_TRACE_WRITES\s|\sTCL_TRACE_READS\s|\sTCL_TRACE_UNSETS\s|\sTCL_TRACE_ARRAY),\nVariableProc,\sNULL);\n\s\s/*\sNow\sexecuting\sa\sTCL_TRACE_ARRAY-trace\s*/\n\s\sTcl_Eval(interp,\s"array\snames\sfoobar");\n\n\s\sreturn\sTCL_OK;\n}\n\nBuild\sa\sDLL\sand\scall\syour\stcl-shell,\sthen\scall:\n%\sload\sarray_test.dll\n\nObservedBehavior:\nThe\soutput\sof\sthe\sabove\scommand\s"load\sarray_test.dll"\sis:\n\nExecuting:\s'array\snames\sfoobar'\n--Traced\sarray\son\sarray\sfoobar((null))\nNow\ssetting\ststkey\s=\ststvalue.\nThis\swill\sincorrectly\scall\sVariableProc\swith\sTCL_TRACE_WRITES\n--Traced\swrite\son\sfoobar(tstkey)\ntstkey\sis\sset\sto\ststvalue\ntstkey\shello\n%\n\nThe\sWrite-trace\sshould\snot\sbe\sexecuted\saccording\sto\sthe\sman-page\n\nDesiredBehavior:\nExpected\sthis\s(from\sthe\sman-page\sfor\sTcl_TraceVar2):\n\nDuring\sread,\swrite,\sand\sarray\straces,\sthe\strace\sprocedure\scan\sread,\swrite,\sor\sunset\sthe\straced\svariable\susing\sTcl_GetVar2,\sTcl_SetVar2,\sand\sother\sprocedures.\sWhile\sproc\sis\sexecuting,\straces\sare\stemporarily\sdisabled\sfor\sthe\svariable,\sso\sthat\scalls\sto\sTcl_GetVar2\sand\sTcl_SetVar2\swill\snot\scause\sproc\sor\sother\strace\sprocedures\sto\sbe\sinvoked\sagain.\s\n\nI\sexpected\sthe\strace\son\s"foobar"\sincludes\sa\strace\son\s"foobar(tstkey)"\sand\sso\s\nthe\strace\sis\snot\sinvoked\sagain.\sMaybe\sI'm\swrong\shere?\n\n\n\nVerified.\s\sThe\sproblem\sis\sthat\sVAR_TRACE_ACTIVE\sis\sset\sfor\sthe\sarray,\sbut\swhen\ssetting\san\selement\sof\sthe\sarray,\spresence\sof\sthat\sflag\sis\sonly\stested\sfor\sthe\sarray\selement,\sand\straces\son\sthe\sarray\sare\sblindly\sexecuted.\s\sThe\sfix\sis\strivial:\s\sin\sCallTraces,\sadd\sa\scheck\sfor\sVAR_TRACE_ACTIVE\son\sthe\sarray\sbefore\sexecuting\straces\son\sthe\sarray.\s\sThe\stest\ssuite\spasses\ssuccessfully\swith\sthis\smodification,\sbut\sthere\sare\sno\sexplicit\stests\sof\sthe\sTCL_TRACE_ARRAY\sstuff\s(that\sfeature\sis\scurrently\snot\sexported\sto\sTcl).\n\nI\scommitted\sthis\schange\sto\sCVS;\sthe\sfix\swill\sgo\sout\swith\s8.4a2.\s\sThanks\sfor\sfinding\sthis\sbug!\n\n\s\s\sEric\sMelski\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sThe\sOther\sTcl\sGuy\n\s\s\sericm\sat\sajubasolutions.com\s\s\s\s\s\s\s\s\s\s\s\sAjuba\sSolutions\n\n--\s07/25/2000\sericm\n\n
J foundin obsolete:\s8.3
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 69.\sOther
J title While\sin\sa\strace-proc,\straces\sare\snot\sdisabled\sfor\sTCL_TRACE
J type Bug
K 219113ffffffffffffffffffffffffffffffffff
U nobody
Z 9388f7be23f0f109edb5638d4425a219