Artifacts Associated With Ticket 2153080fffffffffffffffffffffffffffffffff
Ticket change [9365c160c4] (rid 105807) by nobody on 2008-10-08 12:20:22:
- assignee initialized to: "nijtmans"
- cmimetype initialized to: "text/plain"
- comment initialized to:
if one deletes a coroutine by [rename [info coroutine] {}] and then calls [yield], the coroutine is never deleted and can never be deleted, as only a [return] will effect the deletion and after [yield] the coroutine can never be called again in order to return. I suggest that both [yield] and [info coroutine] should raise an error if called from a deleted coroutine, which would cause the deletion cleanup. Alternatively, [yield] should effect the cleanup. Note, [info coroutine] returns a fully ns-qualified {} name. - Colin. - 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: "nobody"
- subsystem initialized to: "02. Event Loops"
- title initialized to: "coroutine deletion, yield should error"
- type initialized to: "Bug"
Ticket change [3967026f86] (rid 112380) by dkf on 2008-10-08 19:28:15:
- assignee changed to: "msofer"
- icomment:
In what way (apart from the erroneous result from [info coroutine]) is there a problem? What resource is being consumed? % proc foo args {puts "DEBUG: $args"} % proc bar {} {trace add variable v unset foo;yield;rename [info coro] {};puts IN;yield;puts END} % coroutine spong bar % trace add command spong delete foo % info commands tell socket subst open eof pwd glob list pid exec auto_load_index time unknown eval lassign lrange fblocked lsearch auto_import gets case lappend proc break llength variable auto_execok return linsert error catch clock info split array if fconfigure coroutine concat join lreplace source fcopy global switch auto_qualify update foo bar close cd for auto_load file append lreverse format unload read package set binary namespace scan apply spong trace seek while chan flush after vwait dict continue uplevel foreach lset rename fileevent regexp lrepeat tailcall upvar encoding expr unset load regsub history interp exit puts incr lindex lsort tclLog string yield % spong DEBUG: ::spong {} delete IN DEBUG: v {} unset % info commands tell socket subst open eof pwd glob list pid exec auto_load_index time unknown eval lassign lrange fblocked lsearch auto_import gets case lappend proc break llength variable auto_execok return linsert error catch clock info split array if fconfigure coroutine concat join lreplace source fcopy global switch auto_qualify update foo bar close cd for auto_load file append lreverse format unload read package set binary namespace scan apply trace seek while chan flush after vwait dict continue uplevel foreach lset rename fileevent regexp lrepeat tailcall upvar encoding expr unset load regsub history interp exit puts incr lindex lsort tclLog string yield - login: "dkf"
- mimetype: "text/plain"
- subsystem changed to: "45. Parsing and Eval"
- username: "dkf"
Ticket change [ed24c55c37] (rid 103829) by dkf on 2008-10-08 19:28:28:
- foundin changed to: "obsolete: 8.6a3"
Ticket change [df14406fe7] (rid 114962) by msofer on 2008-10-08 22:10:31:
- icomment:
I tend to agree with dkf: the main problem is (was, fix now committed) that [info coro] was returning a wrong name. As returning an error from [info] is not really an option, the fix is that it will now return {}. The new interpretation for [info coro] returning {} is: "there is no command that will resume this coroutine". That happens for one of two reasons: - no coroutine is running - the command to resume the running coroutine has been deleted - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [3b4fe32f6a] (rid 112716) by msofer on 2009-05-01 08:24:17:
- priority changed to: "6"
Ticket change [fdca85f2b1] (rid 108475) by msofer on 2009-05-01 08:26:40:
- priority changed to: "7 High"
Ticket change [7d8a10c293] (rid 97258) by msofer on 2009-05-08 09:03:47:
- closedate changed to: "2009-05-08T02:03:47"
- closer changed to: "msofer"
- icomment:
allow_comments - 1 To be clear: the coroutine IS deleted after that yield - the command is marked as deleted when renamed to {}, and effectively deleted when it yields. The proof: run the following script (under nice, tight busy loop!) and watch the memory it uses: it is constant. proc a {} { puts -nonewline . flush stdout rename [info coroutine] {} yield } while 1 { coroutine b[incr i] a } - login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "msofer"