Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: aee516f4e67d084e2130c5768f65b50f6bb51be0
Ticket: 3008307fffffffffffffffffffffffffffffffff
callerPtr chain does not traverse coro floor
User & Date: coldstore on 2010-05-30 08:13:36
Changes

  1. icomment:
    0x86a7610 is top's coro.  0x86a7a90 is bottom's coro
    
    0x869f470 is saved in bottom's caller when *running top - as we are creating,compiling, then running the bottom coro from the top coro.
    
    0x869f470 is then saved in bottom's running after *yield in bottom, when we have constructed, compiled and run bottom to its first ::yield.
    
    0x869f470 is then restored from bottom's caller in order to resume evaluation of top, which then takes us to *yield in top.
    
    0x869f470 is then saved in top's running in order to process top's ::yield.
    
    SO at this point we have 0x869f470 in both top and bottom's running context.
    
    NRInterpCoroutine restore's top's running, to evaluate its [return].  top returns, destroying its stack (and most importantly 0x869f470)
    
    top has been cleaned up now, but there's more to do in bottom, so ...
    
    NRInterpCoroutine restores bottom's running, which still contains 0x869f470, which was deleted by top
    
    So bottom is running with a stack containing an element deleted by the (now defunct) top.  And it will eventually crash.  As it does.
    
    This is emphatically not a case of deleted content being reused.  It is a case of a stack element being duplicated by a coroutine being created within a running coroutine.
    
    One of the assumptions tacitly made about coroutine creation must not hold true when the caller of ::coroutine is itself a coroutine.
    
    If we could work out which assumption, we could presumably avoid the dependence on this false assumption.
    
    
    
  2. login: "coldstore"
  3. mimetype: "text/plain"
  4. username: "coldstore"