Skip to content
Tcl Source Code History Of Ticket 1066755
Login

History Of Ticket 1066755

Artifacts Associated With Ticket 1066755

  1. Ticket change [c33555aeb2] (rid 111621) by stevebold on 2004-11-15 16:20:57:

    1. assignee initialized to: "mdejong"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      TIP 87 indicates that the default recursion depth for Tcl 
      is 1000
      and that this can be changed by scripts. However, on 
      Windows XP this
      does not seem to be the case.
      
      Consider this script:
      
      set level 0
      proc a {} {
         set ::level [info level]
         a
      }
      a
      
      With the Active Tcl build of 8.5a1, it fails with $level set 
      to 375.
      
      ActiveTcl 8.4.6 failed with $level set to 395.
      
      My own build of 8.4.3 failed with $level set to 902.
      
      Setting calling 'interp recursionlimit {} 2000' makes no 
      difference
      to these numbers.
      
      On Solaris, this problem is not seen.
      
      
    4. foundin initialized to: "obsolete: 8.5a1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "stevebold"
    9. subsystem initialized to: "52. Portability Support"
    10. title initialized to: "Surprisingly low recursion limit on Windows"
    11. type initialized to: "Bug"
  2. Ticket change [f7d66044c0] (rid 91439) by davygrvy on 2004-11-25 03:03:14:

    1. icomment:
      Logged In: YES 
      user_id=7549
      
      are we out of stack space or is it the soft limit?
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. username: "davygrvy"
  3. Ticket change [d85db5dc17] (rid 107421) by davygrvy on 2004-11-25 06:23:42:

    1. icomment:
      Logged In: YES 
      user_id=7549
      
      This must be an actual stack space issue for you as I can go
      to 999 for both 8.4 and 8.5 shells.  But I'm running on Win2K.
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. username: "davygrvy"
  4. Ticket change [fe1cb1ff80] (rid 108524) by stevebold on 2004-11-25 16:56:56:

    1. icomment:
      Logged In: YES 
      user_id=810219
      
      Tried ActiveTcl 8.4.6 on a Windows 2000 box and still saw a 
      limit of 395.
      
      Used 'dumpbin -headers tclsh84.exe' to look at the stack 
      size. On by own build
      of 8.4.3 I see:
      
                231860 size of stack reserve
                  1000 size of stack commit
      
      On ActiveTcl 8.4.6 I see:
      
                100000 size of stack reserve
                  1000 size of stack commit
      
      With ActiveTcl8.5 I see:
      
                100000 size of stack reserve
                  1000 size of stack commit
      
      win/makefile.vc seems to be constant in specifying 2.3MB of 
      stack space for 8.4
      and 8.5. Dumpbin doesn't document the unit of stack size, it 
      appears to be
      in units of 10 bytes.
      
      So it looks like:
      a. ActiveTcl is built with the stack stack size set to the 
      Windows default of 1MB,
         not that in makefile.vc
      b. even 2.3MB is a little too small to achieve a stack depth of 
      1000
      
      
      
    2. login: "stevebold"
    3. mimetype: "text/plain"
    4. username: "stevebold"
  5. Ticket change [de1f04abea] (rid 114789) by davygrvy on 2004-11-25 21:14:28:

    1. assignee changed to: "hobbs"
    2. icomment:
      Logged In: YES 
      user_id=7549
      
      editbin /stack:2300000,4096 tclsh85.exe
      
      That's how to change it after the fact.  The TEA makefile
      should have this modified to add the '-stack:2300000' switch
      to the linker commandline.
      
      
      
      
    3. login: "davygrvy"
    4. mimetype: "text/plain"
    5. username: "davygrvy"
  6. Ticket change [28a422268f] (rid 88736) by davygrvy on 2004-11-26 06:22:41:

    1. icomment:
      Logged In: YES 
      user_id=7549
      
      units for dumpbin are in hex
      2300000 == 0x231860
      
      I think that it's odd that you can only go to 902, as I can
      hit 1795 before the stack runs out.  I wonder if this is an
      XP thing?
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. username: "davygrvy"
  7. Ticket change [1dcfe38ceb] (rid 90877) by stevebold on 2004-11-26 17:18:36:

    1. icomment:
      Logged In: YES 
      user_id=810219
      
      Ok, I tried again today (on XP) and with my 8.4.3 build and,
      with 'interp recursionlimit {} 2000' I'm now able to get
      up to 1987.
      
      I suppose something must have changed in the last couple of 
      weeks
      but I'm not sure what, we haven't changed or rebuilt the 
      interpreter.
      
      I did notice that running the script twice in the same tclsh
      session gives a slightly higher limit the second time around
      (1992 instead of 1987). I wonder if their are other factors
      affecting the permitted size of the stack?
      
      I'll try again in a few days and see if the numbers have shifted
      again. 
      
      
      
    2. login: "stevebold"
    3. mimetype: "text/plain"
    4. username: "stevebold"
  8. Ticket change [ada54d2b70] (rid 101506) by stevebold on 2004-11-26 23:37:39:

    1. icomment:
      Logged In: YES 
      user_id=810219
      
      Also found that, at least in 8.4.3, building using makefile.vc,
      wish is built with a 1MB stack and only tclsh gets the 2.3MB 
      stack. Has this been rationalised in 8.5, if not should it be?
      
      
    2. login: "stevebold"
    3. mimetype: "text/plain"
    4. username: "stevebold"
  9. Ticket change [5b8dba3b31] (rid 118345) by davygrvy on 2004-11-27 03:51:24:

    1. icomment:
      Logged In: YES 
      user_id=7549
      
      yup, wish needs more stack.  I just tested 8.5, and I
      couldn't get past 775.  Added -stack:2300000 to the link and
      brought it up to 1795.
      
      I'll push this out for Tk, but the TEA makefiles need this
      added, too.
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. username: "davygrvy"
  10. Ticket change [c2d7ff2e34] (rid 111552) by hobbs on 2005-10-05 13:36:47:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      Why does TEA need this?  It seems that this should just be
      needed by the Tcl core makefiles and nowhere else.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  11. Ticket change [5616930ecd] (rid 94261) by hobbs on 2007-06-13 02:43:17:

    1. assignee changed to: "dgp"
    2. foundin changed to: "obsolete: 8.5a7"
    3. icomment:
      Logged In: YES 
      user_id=72656
      Originator: NO
      
      Improvements have been made to stack handling that has 8.5a7 seeing 834 levels possible.  Don believes that more aggressive use of TclStackAlloc in the core will get us to the "default" 1000 without needing -stack.
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Out of Date"
    7. username: "hobbs"
  12. Ticket change [6a586b4d29] (rid 128134) by dgp on 2007-06-14 03:39:18:

    1. assignee changed to: "msofer"
    2. icomment:
      Logged In: YES 
      user_id=80530
      Originator: NO
      
      
      There are more places to use TclStackAlloc
      and the newer TclStackRealloc, but it doesn't
      appear those places will impact the particular
      demo script here, which is focused specifically
      on a recursive proc.
      
      The call stack to examine for stack reduction
      in the HEAD is:
      
      TclExecuteByteCode (doInvocation)
      TclEvalObjvKnownCommand
      TclObjInterpProc
      ObjInterpProcEx
      TclObjInterpProcCore
      TclCompEvalObj
      TclExecuteByteCode
      
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. subsystem changed to: "22. [proc] and [uplevel]"
    6. username: "dgp"
  13. Ticket change [6337f73e0d] (rid 92540) by dgp on 2007-06-14 03:44:26:

    1. icomment:
      Logged In: YES 
      user_id=80530
      Originator: NO
      
      
      A simple thing to try would be
      to inline TclObjInterpProcCore
      within what appears to be its
      only caller, ObjInterpProcEx
      
      (which raises the questions
      why it is not a file static
      routine, and why it's in
      the internal stubs table?)
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  14. Ticket change [f7821f1bf6] (rid 91389) by msofer on 2007-06-14 05:50:07:

    1. icomment:
      Logged In: YES 
      user_id=148712
      Originator: NO
      
      As a service to OO extensions: tclOO calls into TclObjInterpProcCore, xotcl and itcl both call into TclObjInterpProc. I guess it could be feasible to modify things so that the core does not call TclObjInterpProc, thus removing one item from the stack. At least gcc optimises that tail call away: TclObjInterpProc does not appear in a stack trace in a standard -O2 (no -g) build.
      
      Otherwise, maybe this is the signal that the time has come to bite the bullet and bring NRE up to date and into HEAD?
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  15. Ticket change [8146c64549] (rid 117001) by msofer on 2007-06-14 09:46:10:

    1. assignee changed to: "hobbs"
    2. icomment:
      Logged In: YES 
      user_id=148712
      Originator: NO
      
      Please test on HEAD - the call to TclCompEvalObj is now gone from that stack trace.
      
      
    3. login: "msofer"
    4. mimetype: "text/plain"
    5. username: "msofer"
  16. Ticket change [28d4fe614b] (rid 88770) by dkf on 2007-06-14 16:27:30:

    1. icomment:
      Logged In: YES 
      user_id=79902
      Originator: NO
      
      TclObjInterpProcCore is an entry point I added so that TclOO's methods don't need to reach too deeply into the core's guts. The alternative to having it is that a *lot* more details get leaked to anyone who needs to build non-standard procedure-like things.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  17. Ticket change [345dbb6342] (rid 106751) by hobbs on 2007-06-15 00:13:21:

    1. assignee changed to: "msofer"
    2. icomment:
      Logged In: YES 
      user_id=72656
      Originator: NO
      
      Improved to 857.  Miguel is looking at the NRE again and other methods to reduce call overheads.
      
      
    3. login: "hobbs"
    4. mimetype: "text/plain"
    5. priority changed to: "4"
    6. resolution changed to: "None"
    7. username: "hobbs"
  18. Ticket change [a02e96503f] (rid 96757) by dkf on 2007-06-16 21:01:46:

    1. icomment:
      Logged In: YES 
      user_id=79902
      Originator: NO
      
      With the HEAD building with msys (optimized, but untweaked) on WinXPSP2, I'm now getting a recursion depth of 1755. Test script was:
      
        interp recursionlimit {} 2000
        proc foo {} {global i;incr i;foo}
        catch {foo bar}
        set i 0
        catch { foo }
        puts $i
        puts [time { catch { foo } } 1000]
        exit
      
      If others can confirm this, I'd call this issue closed.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  19. Ticket change [53abaf2846] (rid 93797) by dgp on 2007-06-18 23:23:39:

    1. icomment:
      Logged In: YES 
      user_id=80530
      Originator: NO
      
      
      perhaps an addition to the test suite
      to alert us if/when the limit gets
      small again?
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  20. Ticket change [d34c6967f6] (rid 123269) by msofer on 2008-06-28 21:23:28:

    1. closedate changed to: "2008-06-28T14:23:28"
    2. closer changed to: "msofer"
    3. status changed to: "Pending"
  21. Ticket change [d2b9254235] (rid 113579) by sf-robot on 2008-07-13 09:20:23:

    1. closedate changed to: "2008-07-13T02:20:23"
    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"