Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9c68f582268aad37aaaa4789d22633c40ae5d725
Ticket: 3008307fffffffffffffffffffffffffffffffff
callerPtr chain does not traverse coro floor
User & Date: coldstore on 2010-05-30 10:55:16
Changes

  1. icomment:
    Tentative diagnosis:
    TclNRCoroutineObjCmd calls TclNREvalObjEx with the command to compile, then evaluate.
    
    The interp passed into TclNREvalObjEx contains the stack frame of CoroutineObjCmd's caller, which is acceptable insofar as the first invocation of that command should probably be able to pass errors back to the caller.
    
    However, at some point (the first ::yield in the coro) this context, complete with the stack of the original caller, becomes the context of the running coro.
    
    This isn't correct.  Once the coro hits its first ::yield, and therefore returns to its creator, it should be running in a global context - that is, the saved running context *must*not* contain the stack frame of the caller, even though it was passed in as the contruction stack.
    
    If this isn't done, and if the caller and creator of a coroutine is itself a coroutine (and even, probably, if it's not) the stack appears in two contexts and can be destroyed independently in either.
    
    I suspect this can be induced without two coroutines in place.
    
    
    
    
  2. login: "coldstore"
  3. mimetype: "text/plain"
  4. username: "coldstore"