Skip to content
Tcl Source Code History Of Ticket 2649975
Login

History Of Ticket 2649975

Artifacts Associated With Ticket 2649975

  1. Ticket change [97fa3f30c2] (rid 110534) by kennykb on 2009-02-28 23:20:34:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      I'm struggling to come up with a smaller example of this
      problem; it's quite nasty.
      
      When the attached 'bugg.tcl' script is run, it
      produces the output,
      
      v should have been found at global level but was found in bar's method bravo
      
      Removing the line:
      
      proc dump args {}
      
      from the script makes it print a play-by-play analysis of what happened.
      
      It appears that everything is working fine right up to the very end, when the last [tailcall] invokes
      
      ::grill create betty
      
      That constructor runs at level 2, despite having been tailcalled from level 1, and causing [upvar 1 v w] to resolve in the wrong callframe.
      
      
    4. foundin initialized to: "obsolete: 8.6b1.1"
    5. is_private initialized to: "0"
    6. priority initialized to: "7 High"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "kennykb"
    10. subsystem initialized to: "35. TclOO Package"
    11. title initialized to:
      bizarre interaction of uplevel, tailcall, method invocation
      
    12. type initialized to: "Bug"
  2. Ticket change [19953ae864] (rid 122823) by kennykb on 2009-03-01 06:20:35:

    1. icomment:
      
      
      File Added - 315619: bugg.tcl
      
      
      
    2. login: "kennykb"
    3. mimetype: "text/plain"
    4. username: "kennykb"
  3. Add attachment "bugg.tcl" [b5b8f898a1] (rid 125291) by kennykb on 2009-03-01 06:20:35.

  4. Ticket change [f538416ee2] (rid 130070) by dkf on 2009-03-16 20:42:59:

    1. assignee changed to: "msofer"
    2. icomment:
      Confirmed with HEAD. At the offending point (just before doing 'set resolution $w' in grill's constructor) doing an 'uplevel 1 dump' produces this output:
        1: ::barney bravo
      That would seem to indicate that we're somehow managing to not stick within the constraints of the [uplevel]ed stack! I have no idea at all how that could possibly happen! Help!
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. priority changed to: "8"
    6. username: "dkf"
  5. Ticket change [4b7bf659ee] (rid 126720) by dkf on 2009-03-17 05:38:01:

    1. icomment:
      
      
      File Added - 318108: bug2.tcl
      
      Here's a simplified version that exhibits the same problem, but with less gunk in the way.
      
      Note that it does not include the puzzling code from the original that wasn't hitting the problem...
      File Added: bug2.tcl
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Ticket change [a49518d207] (rid 110228) by dkf on 2009-03-17 05:50:08:

    1. icomment:
      Evidence! In my script, in procedure 'bravo', changing
          uplevel 1 [list delta ::betty]
      to
          uplevel 1 delta ::betty
      makes the problem go away.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  7. Ticket change [12ce3863b7] (rid 124114) by dkf on 2009-03-17 06:21:29:

    1. icomment:
      
      
      File Deleted - 318108: 
      
      
      
      File Added - 318114: bug2.tcl
      
      This version also exhibits the bug and doesn't use TclOO...
      File Added: bug2.tcl
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  8. Add attachment "bug2.tcl" [6af8ba167f] (rid 128237) by dkf on 2009-03-17 06:21:29.

  9. Ticket change [d873df3eeb] (rid 107438) by dkf on 2009-03-17 06:24:05:

    1. icomment:
      problem seems to be that tailcall doesn't work right from within a procedure called by a pure-list uplevel body
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  10. Ticket change [bf20a81ce9] (rid 102205) by dkf on 2009-03-17 06:25:04:

    1. title changed to: "bizarre interaction of uplevel and tailcall"
  11. Ticket change [d8cec8e608] (rid 107510) by dkf on 2009-03-17 16:17:35:

    1. icomment:
      Having slept on it, I think the issue is related to the fact that TclNREvalObjEx-list doesn't push the same callbacks as TclNREvalObjEx-string. Respectively:
      
        TclNREvalObjEx-list:
          TEOEx_ListCallback
          NRCommand
          NRRunObjProc
      
        TclNREvalObjEx-string:
          TEOEx_ByteCodeCallback
          NRCallTEBC
      
      According to what I can (and can't) see in the code, the issue might be that NRCommand doesn't do tailcall processing; that's only done in TEBC (which doesn't get called at this level on the canonical-list route).
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  12. Ticket change [6cf443492a] (rid 128609) by msofer on 2009-03-20 06:34:40:

    1. closedate changed to: "2009-03-19T23:34:40"
    2. closer changed to: "msofer"
    3. icomment:
      
      
      allow_comments - 1
      
      These two examples were added to tests/tailcall.test
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "msofer"