Skip to content
Tcl Source Code History Of Ticket 217929
Login

History Of Ticket 217929

Artifacts Associated With Ticket 217929

  1. Ticket change [d0faeca661] (rid 113275) by nobody on 2000-10-26 00:46:10:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. 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.
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.2.1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to: "Stack overflow because of bad refCount"
    11. type initialized to: "Bug"
  2. Ticket change [1b2cda4ace] (rid 123099) by welch on 2000-10-26 08:10:54:

    1. closedate changed to: "2000-10-26T01:10:54"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [96c03dca38] (rid 106377) by dgp on 2001-04-14 02:41:54:

    1. closedate changed to: "2001-04-13T19:41:54"
    2. closer changed to: "dgp"
    3. subsystem changed to: "47. Bytecode Compiler"