Artifacts Associated With Ticket 217929
Ticket change [d0faeca661] (rid 113275) by nobody on 2000-10-26 00:46:10:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 3392 Bug Version: 8.2.1 SubmitDate: '1999-11-05' LastModified: '1999-11-08' Severity: CRIT Status: Closed Submitter: techsupp ChangedBy: hobbs RelatedBugIDs: 3396 OS: Windows NT OSVersion: 4.0 FixedDate: '2000-10-25' ClosedDate: '1999-11-08' Name: Kory Hopkins ReproducibleScript: Just compile and run this .cpp file: extern "C" { #include "Tcl.h" #include "tclInt.h" EXTERN voidTclpInitLibraryPath _ANSI_ARGS_((CONST char *argv0)); } void main() { Tcl_Interp* theInterpreter_p; Tcl_Obj* theTclStrObj_p1, *theTclStrObj_p2; TclpInitLibraryPath(NULL); theInterpreter_p = Tcl_CreateInterp(); if (theInterpreter_p == 0) throw 0; if ( Tcl_Init(theInterpreter_p) != TCL_OK ) throw 0; // // Do the first set. This works fine. // theTclStrObj_p1 = Tcl_NewStringObj("set one a", -1); Tcl_EvalObj(theInterpreter_p, theTclStrObj_p1); Tcl_DecrRefCount(theTclStrObj_p1); // // Do second set. Somehow theTclStrObj_p2->refCount is incremented at the // following locations (I didn't search all the way down but this is the // stack where I stopped searching): // // inside tclBasic.c: Tcl_EvalObjEx() at the following line: //result = tclByteCodeType.setFromAnyProc(interp, objPtr); // // setFromAnyProc() calls TclSetByteCodeFromAny() // // inside tclCompile.c: TclSetByteCodeFromAny() at the following line: //result = TclCompileScript(interp, string, length, nested, &compEnv); // // // So, if you just let this code run the stack will eventualy overflow // with these four function being called recursively filling up the stack: // // TclFreeObj() // FreeByteCodeInternalRep() // TclCleanupByteCode() // TclReleaseLiteral() // TclFreeObj() // .... // theTclStrObj_p2 = Tcl_NewStringObj("set two b", -1); Tcl_EvalObj(theInterpreter_p, theTclStrObj_p2); Tcl_DecrRefCount(theTclStrObj_p2); } ObservedBehavior: See comments in code: // Do second set. Somehow theTclStrObj_p2->refCount is incremented at the // following locations (I didn't search all the way down but this is the // stack where I stopped searching): // // inside tclBasic.c: Tcl_EvalObjEx() at the following line: //result = tclByteCodeType.setFromAnyProc(interp, objPtr); // // setFromAnyProc() calls TclSetByteCodeFromAny() // // inside tclCompile.c: TclSetByteCodeFromAny() at the following line: //result = TclCompileScript(interp, string, length, nested, &compEnv); // // // So, if you just let this code run the stack will eventualy overflow // with these four function being called recursively filling up the stack: // // TclFreeObj() // FreeByteCodeInternalRep() // TclCleanupByteCode() // TclReleaseLiteral() // TclFreeObj() // .... // DesiredBehavior: The object should only have its refcount incremented to 1, not 2. Because, its 2 I am assuming that this is causing the infinite loop. - foundin initialized to: "obsolete: 8.2.1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "Stack overflow because of bad refCount"
- type initialized to: "Bug"
Ticket change [1b2cda4ace] (rid 123099) by welch on 2000-10-26 08:10:54:
- closedate changed to: "2000-10-26T01:10:54"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [96c03dca38] (rid 106377) by dgp on 2001-04-14 02:41:54:
- closedate changed to: "2001-04-13T19:41:54"
- closer changed to: "dgp"
- subsystem changed to: "47. Bytecode Compiler"