Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8efa4ae70f476d103cc65a3f82826d62a90c03db5527cecce35055f8f46e7eaa
Ticket: 3592747fffffffffffffffffffffffffffffffff
(tailcall|yieldto) failed to find the proper namespace Abort
User & Date: pooryorick on 2018-06-23 17:00:22
Changes

  1. assignee changed to: "aku"
  2. closer changed to: "nobody"
  3. comment changed to:
    Under some circumstances a coroutine can be invoked via ::yieldto while the namespace in which it resides is dying (nsPtr->flags&NS_DYING)
    
    This may occur, and is occuring, for example, when a TclOO object is being destroyed, and a coroutine within it is invoked by an event.
    
    The call to TclGetNamespaceFromObj() at tclBasic.c:8532 will indicate an error, because the current frame's namespace is not considered to match itself in the case that it is dying.
    
    I am unsure what the purpose of the test is, or under what circumstances the two namespaces might differ, but this abort occurs as a result of script evaluation, and hence should be considered a bug.
    
  4. icomment:
    The following script reproduces the issue:
    
    <code><verbatim>
    namespace eval ns {
        proc p args {
            ::tailcall [namespace current] {*}$args
        }
        namespace eval [namespace current] {
            namespace delete [namespace current]
            p
        }
    }
    </verbatim></code>
    
    [https://core.tcl.tk/tips/doc/trunk/tip/498.md|TIP 498] is one solution to this
    issue.
    
  5. login: "pooryorick"
  6. mimetype: "text/x-fossil-wiki"
  7. severity changed to: "Minor"