Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2debc3b81e2d67e171eb11d809212367421f46ecb79e0d553fefd4e1d2cb8b5e
Ticket: f9800d52bd61f240938dbd3c3c6364c8a6184194
vwait is not NRE-enabled, and yieldto cannot find the right splicing spot
User & Date: pooryorick on 2021-06-19 21:36:06
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    At least as of [07f12cf7209a23fa3], core-8-branch, the script below aborts.
    The trouble begins with the C stack being busy because c2 has been called from
    with <code>vwait</code>, which is not yet NRE-enabled.  Although the error
    message talks about tailcall, it is really about <code>yieldto</code>, which
    calls <code>TclSetTailcall</code>.
    
    
    <code><verbatim>
    proc main_coro {} {
    	set done [catch {
    		coroutine c1 p0 
    		yieldto c1
    		coroutine c2 p1
    		after 0 [list [namespace which c2]]
    		vwait forever 
    	} cres copts]
    }
    
    proc p0 {} {
    	yield
    	::tailcall main
    }
    
    proc p1 {} {
    	yield
    	set this [info coroutine]
    	set script [list ::yieldto [list $this]]
    	yieldto try $script on error {cres copt} "
    		puts \[list uh-oh \$cres]
    		[list $this]
    	"
    	set script [list ::yieldto $this]
    	yieldto ::try $script
    }
    
    
    coroutine main main_coro
    </verbatim></code>
    
    <b>Output:</b>
    
    <verbatim>
    uh-oh {cannot yield: C stack busy}
    tailcall cannot find the right splicing spot: should not happen!
    Aborted (core dumped)
    </verbatim>
    
  5. is_private changed to: "0"
  6. login: "pooryorick"
  7. priority changed to: "5 Medium"
  8. resolution changed to: "None"
  9. severity changed to: "Critical"
  10. status changed to: "Open"
  11. submitter changed to: "pooryorick"
  12. subsystem changed to: "- New Builtin Commands"
  13. title changed to:
    vwait is not NRE-enabled, and yieldto cnot find the right splicing spot
    
  14. type changed to: "Bug"