Artifacts Associated With Ticket 3046594
Ticket change [da5be15cb0] (rid 107766) by dgp on 2010-08-16 20:16:06:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
% proc foo {} {try {tailcall concat} finally {}} % foo tailcall called from within a catch environment % proc bar {} {set try try; $try {tailcall concat} finally {}} % bar - foundin initialized to: "obsolete: 8.6b1.1"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "60. NRE and coroutines"
- title initialized to: "tailcall/try inconsistency compiled/direct"
- type initialized to: "Bug"
Ticket change [8bc2971014] (rid 127632) by dgp on 2010-08-17 23:58:11:
- icomment:
Worse related example: % proc foo {} {set catch catch; $catch {tailcall concat}} % foo Program received signal SIGSEGV, Segmentation fault. 0x00000001 in ?? () (gdb) bt #0 0x00000001 in ?? () #1 0x080e2414 in TclNRRunCallbacks (interp=0x81c2eb0, result=0, rootPtr=0x821cfb0, tebcCall=1) at /home/dgp/cvs/tcl-only/generic/tclBasic.c:4324 #2 0x0816ee9b in TclExecuteByteCode (interp=0x81c2eb0, codePtr=0x824c220) at /home/dgp/cvs/tcl-only/generic/tclExecute.c:6596 #3 0x080e26f9 in NRCallTEBC (data=0x823dd8c, interp=0x81c2eb0, result=0) at /home/dgp/cvs/tcl-only/generic/tclBasic.c:4400 #4 0x080e2414 in TclNRRunCallbacks (interp=0x81c2eb0, result=0, rootPtr=0x0, tebcCall=0) at /home/dgp/cvs/tcl-only/generic/tclBasic.c:4324 #5 0x080e4b64 in TclEvalObjEx (interp=0x81c2eb0, objPtr=0x8246844, flags=131072, invoker=0x0, word=0) at /home/dgp/cvs/tcl-only/generic/tclBasic.c:5941 #6 0x080e4aeb in Tcl_EvalObjEx (interp=0x81c2eb0, objPtr=0x8246844, flags=131072) at /home/dgp/cvs/tcl-only/generic/tclBasic.c:5922 #7 0x0817cfc3 in Tcl_RecordAndEvalObj (interp=0x81c2eb0, cmdPtr=0x820ef80, flags=131072) at /home/dgp/cvs/tcl-only/generic/tclHistory.c:192 #8 0x080730e1 in Tcl_Main (argc=-1, argv=0xbfffe0f8, appInitProc=0x80545bb <Tcl_AppInit>) at /home/dgp/cvs/tcl-only/generic/tclMain.c:471 #9 0x080545ac in main (argc=Cannot access memory at address 0x1a ) at /home/dgp/cvs/tcl-only/unix/tclAppInit.c:85 - login: "dgp"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- username: "dgp"
- icomment:
Ticket change [b763f7bb8d] (rid 125583) by msofer on 2010-08-18 02:35:16:
- icomment:
These two are related but not identical. 1. non-bc'ed catching of tailcalls is there, but it is broken (hence the segfault) 2. bc'ed try uses the catch mechanism, hence does not permit tailcalling out of the try body 3. non-bc'ed try is not aware of tailcalls
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [c1bfdf2470] (rid 111374) by msofer on 2010-08-18 03:14:09:
- icomment:
Discussion of the second example moved over to #3047235
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [54af610b1d] (rid 93989) by msofer on 2010-08-18 22:55:42:
- closedate changed to: "2010-08-18T15:55:42"
- closer changed to: "msofer"
- icomment:
Inconsistency fixed in HEAD. Leaving open with a question: should the error message change to "tailcall called from within a catch or try environment"?
- login: "msofer"
- mimetype: "text/plain"
- priority changed to: "7 High"
- resolution changed to: "Fixed"
- status changed to: "Pending"
- username: "msofer"
Ticket change [85427aa3e2] (rid 131286) by msofer on 2010-08-18 22:56:11:
- assignee changed to: "dgp"
Ticket change [25b7700d1d] (rid 88217) by ferrieux on 2010-08-18 23:33:48:
- icomment:
I think so :)
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [162a7d47e1] (rid 124678) by dgp on 2010-08-19 00:04:58:
- icomment:
I'm not fully convinced that a refusal error is the right design. With that reservation stated, if you do convince me, I would hope we could come up with an error message that would not need maintenance every time a new command with [catch]-like function was addded.
- login: "dgp"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "dgp"
- icomment:
Ticket change [1b6cf550c7] (rid 123149) by dgp on 2010-08-19 00:08:48:
- icomment:
Keep in mind this quirk as well: % proc foo {} {try {tailcall concat}} % foo % With no 'finally' and no handlers, the [try] command doesn't actually create a "catch environment" to disallow [tailcall]. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [e00cdfb309] (rid 115124) by dgp on 2010-08-19 00:10:16:
- icomment:
Conversely, "catch environment" does show up places you might not expect it: % proc bar {} {subst {[tailcall concat]}} % bar tailcall called from within a catch environment - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [5d66426182] (rid 115454) by msofer on 2010-08-19 00:31:41:
- icomment:
how we got here is ... (a) can't tailcall out of a catch range, in order to avoid sidestepping hand-made try-finally constructs (b) as try (and subst) use the CATCH instruction, and TEBC has no way to know which command it is running, they block tailcalls (when bc'ed) as a side-effect of that decision
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [5ae09af8a1] (rid 118224) by msofer on 2010-08-30 21:09:28:
- closedate changed to: "2010-08-30T14:09:28"
- closer changed to: "msofer"
- icomment:
allow_comments - 1 New implementation from #3048771 fixes this issue
- login: "msofer"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "msofer"