Skip to content
Tcl Source Code History Of Ticket 60559fd4a6
Login

History Of Ticket 60559fd4a6

Artifacts Associated With Ticket 60559fd4a6

  1. Ticket change [679c5a86f8] (rid 171002) by dgp on 2019-04-11 16:02:52:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      $ make test-tcl TESTFLAGS='-singleproc -file "coroutine.test info.test" -match "coroutine-7.6 info-23.0.1"'
      ...
      ==== info-23.0.1 eval'd info frame FAILED
      ==== Contents of test case:
      
          eval {info frame}
      
      ---- Result was:
      13
      ---- Result should have been (glob matching):
      1[12]
      ==== info-23.0.1 FAILED
      
    5. foundin initialized to: "8.6+"
    6. is_private initialized to: "0"
    7. login: "dgp"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "dgp"
    13. subsystem initialized to: "45. Parsing and Eval"
    14. title initialized to: "-singleproc + coroutine-7.6 + info-23.0.1 => fail"
    15. type initialized to: "Bug"
  2. Ticket change [473c12ef52] (rid 171003) by dgp on 2019-04-11 16:53:11:

    1. icomment:
      
      Bisecting says then unhappiness starts here:
      
      https://core.tcl-lang.org/tcl/info/0c54ff4afafe9fe2
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  3. Ticket change [378d594fa2] (rid 171004) by dkf on 2019-04-11 18:32:41:

    1. icomment:
      Seems to be an inconsistent state somewhere. Here's an illustrative interactive session:
      <pre>
      % info frame
      1
      % eval {
          proc foo args {}
          trace add execution foo enter {catch yield}
          coroutine demo foo
          rename foo {}
      }
      % info frame
      1
      % eval {
          info frame
      }
      2
      % eval {
          proc foo args {}
          trace add execution foo enter {catch yield}
          coroutine demo foo
          rename foo {}
          info frame
      }
      3
      </pre>
      
    2. login: "dkf"
    3. mimetype: "text/html"
    4. priority changed to: "6"
  4. Ticket change [a0f3b1054e] (rid 171005) by dkf on 2019-04-11 19:28:49:

    1. icomment:
      The following test case (<i>provisionally</i> named) shows that this has nothing to do with coroutines. It does have plenty to do with <code>foo</code> having a direct <code>compileProc</code> (special case to allow disabling logging/asserts).
      <pre>
      test coroutine-7.6a {Early yield crashes} -setup {
          set result {}
      } -body {
          proc foo args {}
          set BaseFrameLevel [info frame]
          eval {
              lappend result [expr {[info frame] - $BaseFrameLevel}]
              trace add execution foo enter list
              lappend result [expr {[info frame] - $BaseFrameLevel}]
          }
      } -cleanup {
          rename foo {}
          unset -nocomplain result BaseFrameLevel
      } -result {1 1}
      </pre>
      This is weird stuff!
      
    2. login: "dkf"
    3. mimetype: "text/html"
  5. Ticket change [c38b45213e] (rid 171020) by sebres on 2019-04-11 20:58:46:

    1. icomment:
      It looks like the epoch-bump (with followed re-compilation) is indirectly responsible for this disaster:
      
      <code><pre>
      set result {}
      proc bar args {}
      proc foo args {}
      set BaseFrameLevel [info frame]
      eval {
        lappend result [expr {[info frame] - $BaseFrameLevel}] [regexp -inline {^\S+} [dict get [info frame -1] cmd]]
        rename bar buz; ## ********** change of compileEpoch.
        lappend result [expr {[info frame] - $BaseFrameLevel}] [regexp -inline {^\S+} [dict get [info frame -1] cmd]]
        puts $result
      }
      
      set result {}
      eval {
        lappend result [expr {[info frame] - $BaseFrameLevel}] [regexp -inline {^\S+} [dict get [info frame -1] cmd]]
        rename buz bar; ## ********** change of compileEpoch.
        lappend result [expr {[info frame] - $BaseFrameLevel}] [regexp -inline {^\S+} [dict get [info frame -1] cmd]]
        puts $result
      }
      </pre></code>
      
      So interpreter tracing is not involved.
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  6. Ticket change [bb65d8b34e] (rid 171021) by dkf on 2019-04-11 21:39:09:

    1. icomment:
      It's totally the epoch bump. That pushes that stack frame's evaluation engine into a state where it uses interpretation instead of compilation until the frame is purged, which is a long time away for the global stack frame in a <code>-singleproc 1</code> situation (longer than in 8.5; 8.6 compiles more aggressively for good NRE-support reasons), and interpretation sees more frames in <code>info frame</code> than compilation.
      <p>
      This is evil evil evil, and not a bug that we should fix. Except for the tests being too keen on triggering the bump. The tests that cause the problem (that I've seen; there might be more) are <code>coroutine-7.6</code> and <code>coroutine-7.7</code>.
      
    2. login: "dkf"
    3. mimetype: "text/html"
  7. Ticket change [f887586604] (rid 171026) by dkf on 2019-04-11 21:41:55:

    1. icomment:
      See [https://core.tcl-lang.org/tcl/timeline?r=bug-60559fd4a6] for what I think the fix should be.
      
    2. login: "dkf"
    3. mimetype: "text/x-fossil-wiki"
  8. Ticket change [fd17ecad7d] (rid 171066) by dgp on 2019-04-17 15:09:51:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2458591.13184122"
    3. closer changed to: "dgp"
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"