Artifacts Associated With Ticket 3592747fffffffffffffffffffffffffffffffff
Ticket change [f01b04dae5] (rid 109123) by coldstore on 2012-12-05 08:40:10:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized 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.
- foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "coldstore"
- subsystem initialized to: "None"
- title initialized to: "yieldto failed to find the proper namespace Abort"
- type initialized to: "Bug"
Ticket change [5a5aacc09f] (rid 118128) by coldstore on 2012-12-05 15:41:59:
- subsystem changed to: "60. NRE and coroutines"
Ticket change [216959f721] (rid 130578) by msofer on 2012-12-05 17:36:45:
- icomment:
1. no script to repro? 2. any suggestion as to what should happen in that case? Would an error be in order?
- login: "msofer"
- mimetype: "text/plain"
- priority changed to: "8"
- username: "msofer"
- icomment:
Ticket change [dba2a226ba] (rid 107995) by msofer on 2012-12-05 17:45:00:
- icomment:
Note: the problem is likely to appear also with [tailcall].
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [25566c21c4] (rid 88153) by msofer on 2012-12-06 09:39:05:
- icomment:
The problem is indeed with [tailcall] whose guts are reused by [yieldto]. The current namespace was being cached in an nsNameType Tcl_Obj in order to insure its survival, and as a failure to resolve "could not happen" it was signaled by a panic. As colin is wont to do, he triggered the impossible! Fixed by using a better lifetime management of the namespace.
- login: "msofer"
- mimetype: "text/plain"
- title changed to:
(tailcall|yieldto) failed to find the proper namespace Abort
- username: "msofer"
- icomment:
Ticket change [c66f909656] (rid 121768) by msofer on 2013-03-19 21:02:55:
- assignee changed to: "coldstore"
- icomment:
Is this bug still present?
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
Ticket change [8e6edf75e1] (rid 120105) by dkf on 2013-03-20 16:27:56:
- icomment:
This is why it's great to have a test, so we can confirm when the bug is dead…
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [8efa4ae70f] (rid 164125) by pooryorick on 2018-06-23 17:00:22:
- assignee changed to: "aku"
- closer changed to: "nobody"
- 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.
- 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. - login: "pooryorick"
- mimetype: "text/x-fossil-wiki"
- severity changed to: "Minor"
Ticket change [fb4a33dde0] (rid 164126) by pooryorick on 2018-06-23 17:12:25:
- icomment:
A slightly smaller example: <code><verbatim> namespace eval ns { proc p args { ::tailcall [namespace current] {*}$args } namespace delete [namespace current] p } </verbatim></code> - login: "pooryorick"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [550dd9940e] (rid 164127) by pooryorick on 2018-06-23 21:28:39:
- icomment:
If <code>{*}</code> from the example the compiled path for <code>tailcall</code> is taken, and in the compiled variant an error is raised: <code><verbatim> namespace "::ns" not found </verbatim></code> - login: "pooryorick"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [3b249618d7] (rid 164133) by pooryorick on 2018-06-24 07:24:20:
- icomment:
In [9198c16407f3] namespace handling is removed from <code>TclNRTailcallObjCmd</code>, allowing <code>TclNRTailcallObjCmd</code> to handle namespace issues later. This aligns the behaviour of the non-compiled variant with the compiled one: An error is produced if the namespace is not found.
- login: "pooryorick"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Remind"
- icomment:
Ticket change [9d6a271afb] (rid 164223) by dgp on 2018-06-27 15:48:31:
- icomment:
This is now fixed and the ticket can be closed?
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [f6eb7e98ae] (rid 164254) by dgp on 2018-06-28 18:48:32:
- assignee changed to: "pooryorick"
- closedate changed to: "2458298.28370403"
- closer changed to: "dgp"
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"