Skip to content
Tcl Source Code History Of Ticket 1482718
Login

History Of Ticket 1482718

Artifacts Associated With Ticket 1482718

  1. Ticket change [dfc5ed2d89] (rid 115067) by eugene_cdn on 2006-05-05 19:57:21:

    1. assignee initialized to: "dgp"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OS: Solaris 5.8.
      Removing trace on second level of recursive call can
      corrupt or substitute wrong number of compiled
      variables for first level of recursion. Then, on
      return, TclLookupSimpleVar() will have two different
      values of number of compiled variables in
         procPtr->numCompiledLocals (5)
      and
         varFramePtr->numCompiledLocals (3)
      at tclVar.c, line 818.
      Then loop for all variables (line 823) will use bigger
      value, procPtr->numCompiledLocals, and it will crash on
      accessing varFramePtr->compiledLocals out of bound.
      Please use attached testcase for reproducing the bug.
      
      
    4. foundin initialized to: "obsolete: 8.4.11"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "eugene_cdn"
    9. subsystem initialized to: "46. Traces"
    10. title initialized to: "crash after removing trace in recursive call"
    11. type initialized to: "Bug"
  2. Ticket change [e36d383bf6] (rid 87798) by eugene_cdn on 2006-05-06 02:57:21:

    1. icomment:
      
      
      File Added - 176972: trace.tgz
      
      
      
    2. login: "eugene_cdn"
    3. mimetype: "text/plain"
    4. username: "eugene_cdn"
  3. Add attachment "trace.tgz" [39bba61d3b] (rid 112442) by eugene_cdn on 2006-05-06 02:57:21.

  4. Ticket change [79205034ae] (rid 90071) by dgp on 2006-05-06 11:30:56:

    1. foundin changed to: "obsolete: 8.4.14"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      
      looks like it's still there in 8.4.13.
      
      Upping priority to see if it can
      get resolved before 8.4.14.
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "9 Immediate"
    6. username: "dgp"
  5. Ticket change [e0262e83f3] (rid 115144) by dgp on 2006-05-09 02:32:23:

    1. subsystem changed to: "07. Variables"
  6. Ticket change [fee37d9eaf] (rid 108662) by dgp on 2006-05-09 02:32:24:

    1. assignee changed to: "msofer"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Traces are probably involved,
      but the root cause of the
      crash appears to be corruption
      of a Var struct, so let's bring
      the Var expert in on this.
      
      Miguel, the crash happens at
      line 828 of tclVar.c where
      localVarPtr->name has a bogus
      value, even though
      localVarPtr->refCount is 19.
      
      Any hints?
      
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. username: "dgp"
  7. Ticket change [c67e2c2c57] (rid 121782) by dgp on 2006-05-09 03:01:26:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      ok, as original report already
      observed, root cause is that
      procPtr->numCompiledLocals
      and varFramePtr->numCompiledLocals
      do not agree.
      
      Since the for loop at line 825
      fundamentally loops over
      varFramePtr->compiledLocals, it
      would make more sense to use
      varFramePtr->numCompiledLocals
      to set the loop limit.  Simply
      making that change appears
      to fix this bug.
      
      But leaves several questions
      raised.  Why do we need to store
      the same info in two places?
      And once we've done that, just what
      corruption is forcing them
      to get out of sync?
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  8. Ticket change [7e1d32042a] (rid 97353) by dgp on 2006-05-09 04:16:35:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      oops!  the loop traverses
      data from both structs,
      so the two numCompiledLocals
      simply must agree.
      
      miguel reports:
      miguelthe CallFrame's is set from the Proc's at tclProc.c
      line 979. Should not be modified, ever 
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  9. Ticket change [47267eaedd] (rid 99643) by dgp on 2006-05-09 11:21:42:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      I added a test that the two
      numCompiledLocals values were
      the same, and a Tcl_Panic()
      when they are not.  This
      let me detect the problem directly
      without needing lots of other
      things "just so" to force a
      segfault.
      
      This let me simplify the demo
      script to:
      
      load libtrace.so
      proc Console:Eval {cmd} {
          set enterx 0
          set ret [uplevel #0 $cmd]
          if {$enterx} {}
          return $ret
      }
      Console:Eval {
          closeTrace
          Console:Eval {}
      }
      
      The value mismatch
      happens because [closeTrace]
      calls Tcl_DeleteTrace()
      which advances the bytecode
      compile epoch (line 5208
      of tclBasic.c).
      
      This means the nested
      [Console:Eval] call is
      a different compile from
      the outer one, and the two
      compiles are done under
      different settings of the
      DONT_COMPILE_CMDS_INLINE
      flag.  The different compile
      rules may well explain the
      different number of compiledLocals.
      
      The remaining bug here appears
      to be that the CallFrame of
      the outer call now has a procPtr
      field pointing to a Proc corresponding
      to the re-compile?
      
      Either that should not happen, or
      if it's ok for that to happen, then
      the TclLookupSimpleVar needs a rewrite
      to not assume the CallFrame and Proc
      agree about their compiledLocals lists.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  10. Ticket change [38cc6be9ae] (rid 112271) by dgp on 2006-05-10 21:06:00:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Based on a plan laid out
      by miguel, I have a fix
      for this in my development
      sources.  I'll post a patch
      for testing after access to
      CVS is restored.
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. subsystem changed to: "22. [proc] and [uplevel]"
    6. username: "dgp"
  11. Ticket change [bae88491f6] (rid 129393) by dgp on 2006-05-10 22:06:49:

    1. icomment:
      
      
      File Added - 177474: 1482718.patch
      
      Logged In: YES 
      user_id=80530
      
      
      Here's the patch against
      8.4.13.
      
      Note the patch leaves the
      bug unfixed when the routine
      getting recompiled is due to
      a call to TclProcCompileProc()
      from an extension intruding on
      internals.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [b0ca310598] (rid 98041) by dgp on 2006-05-10 23:02:15:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Patch is flawed; examining...
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  13. Ticket change [f56df319f1] (rid 130103) by dgp on 2006-05-10 23:18:33:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Here's the corrected patch
      for 8.4.13.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  14. Add attachment "1482718.patch" [ecc7106440] (rid 103764) by dgp on 2006-05-10 23:18:34.

  15. Ticket change [4227dc1dc6] (rid 116316) by dgp on 2006-05-10 23:18:34:

    1. icomment:
      
      
      File Deleted - 177474: 
      
      
      
      File Added - 177485: 1482718.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  16. Ticket change [acb0ad7bf1] (rid 101338) by dgp on 2006-05-10 23:23:53:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      And the corresponding patch
      for 8.5a4
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  17. Add attachment "1482718-85.patch" [c14e0c125b] (rid 111301) by dgp on 2006-05-10 23:23:53.

  18. Ticket change [9fca4d36aa] (rid 96702) by dgp on 2006-05-10 23:23:54:

    1. icomment:
      
      
      File Added - 177487: 1482718-85.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  19. Ticket change [84fce49296] (rid 131245) by dgp on 2006-05-14 00:16:53:

    1. status changed to: "Closed"
  20. Ticket change [1a71b4faba] (rid 122979) by dgp on 2006-05-14 00:16:54:

    1. closedate changed to: "2006-05-13T17:16:54"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      
      fixed for 8.4.14 and 8.5a5
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. username: "dgp"
  21. Ticket change [e70d7f94f9] (rid 104390) by msofer on 2008-08-10 22:38:01:

    1. icomment:
      Logged In: YES 
      user_id=148712
      Originator: NO
      
      Removed the fix in HEAD: this is not needed at least since varReform, where the local variable data at runtime is read from the CallFrame and/or the LocalCache.
      
      Reopened to consider this for backporting to 8.5, although my inclination is to leave the stable branch alone: this is removing unneeded code, not a bugfix.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "msofer"
  22. Ticket change [410d82b421] (rid 116110) by dgp on 2008-08-13 21:32:16:

    1. assignee changed to: "msofer"
  23. Ticket change [573a883bda] (rid 94447) by msofer on 2008-08-14 03:37:59:

    1. closedate changed to: "2008-08-13T20:37:59"
    2. closer changed to: "msofer"
    3. status changed to: "Pending"
  24. Ticket change [0752eb27ab] (rid 89376) by sf-robot on 2008-08-29 09:20:18:

    1. closedate changed to: "2008-08-29T02:20:18"
    2. closer changed to: "sf-robot"
    3. icomment:
      Logged In: YES 
      user_id=1312539
      Originator: NO
      
      This Tracker item was closed automatically by the system. It was
      previously set to a Pending status, and the original submitter
      did not respond within 14 days (the time period specified by
      the administrator of this Tracker).
      
      
    4. login: "sf-robot"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "sf-robot"