Tcl Source Code

View Ticket
Login
Ticket UUID: 3487626
Title: CompileWord OBOEs in compiled [dict] subcommands
Type: Bug Created on: 2012-02-14 17:07:27
Submitter: sebres Assigned to: dgp
Subsystem: 47. Bytecode Compiler Severity: Minor
Priority: 9 Immediate Last modified: 2013-09-19 19:07:49
Status: Closed Closed by: dgp
Resolution: Fixed Closed on: 2013-09-19 19:07:49
Version: obsolete: 8.5.11
Description:
I tried to test my new clock.tcl with current core-8-5-branch.
commited in http://core.tcl.tk/tcl/info/aa30a04b13

In my test script, it's flown out with exception by following command:
% clock scan "WednesdayJuly/29/1987" -format %A%B/%d/%Y -locale en

With original tcl 8.5.11, it runs succesfully (all clock tests also).

It's again something around ensemble / compiling.
The call stack...

!EXCEPT!
TclAdvanceContinuations(int * 0x00268384, int * * 0x0026827c, int 1066) line 4590 + 13 bytes
TclCompileScript(Tcl_Interp * 0x009d8468, const char * 0x00ac8740, int 113, CompileEnv * 0x00268730) line 1338 + 32 bytes
TclCompileCmdWord(Tcl_Interp * 0x009d8468, Tcl_Token * 0x009d9790, int 1, CompileEnv * 0x00268730) line 1947 + 27 bytes
TclCompileDictForCmd(Tcl_Interp * 0x009d8468, Tcl_Parse * 0x009d96d8, Command * 0x009e3448, CompileEnv * 0x00268730) line 976 + 27 bytes
TclCompileScript(Tcl_Interp * 0x009d8468, const char * 0x00ac8318, int 1397, CompileEnv * 0x00268730) line 1441 + 27 bytes
TclSetByteCodeFromAny(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x00abc8f8, int (Tcl_Interp *, CompileEnv *, void *)* 0x00000000, void * 0x00000000) line 531 + 24 bytes
SetByteCodeFromAny(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x00abc8f8) line 623 + 17 bytes
ProcCompileProc(Tcl_Interp * 0x009d8468, Proc * 0x00a89958, Tcl_Obj * 0x00abc8f8, Namespace * 0x009ef0e8, const char * 0x101776d8, const char * 0x011bf330, Proc * * 0x002690a0) line 2059 + 16 bytes
PushProcCallFrame(void * 0x00a89958, Tcl_Interp * 0x009d8468, int 2, Tcl_Obj * const * 0x009d9690, int 0) line 1593 + 111 bytes
TclObjInterpProc(void * 0x00a89958, Tcl_Interp * 0x009d8468, int 2, Tcl_Obj * const * 0x009d9690) line 1651 + 23 bytes
TclEvalObjvInternal(Tcl_Interp * 0x009d8468, int 2, Tcl_Obj * const * 0x009d9690, const char * 0xffffffff, int -1, int 0) line 3703 + 27 bytes
TclExecuteByteCode(Tcl_Interp * 0x009d8468, ByteCode * 0x011cf0a0) line 2417 + 29 bytes
TclObjInterpProcCore(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x011a63c0, int 1, void (Tcl_Interp *, Tcl_Obj *)* 0x1010085e MakeProcError(Tcl_Interp *, Tcl_Obj *)) line 1763 + 13 bytes
TclObjInterpProc(void * 0x00a55e50, Tcl_Interp * 0x009d8468, int 4, Tcl_Obj * const * 0x009d94ec) line 1653 + 22 bytes
TclEvalObjvInternal(Tcl_Interp * 0x009d8468, int 4, Tcl_Obj * const * 0x009d94ec, const char * 0xffffffff, int -1, int 0) line 3703 + 27 bytes
TclExecuteByteCode(Tcl_Interp * 0x009d8468, ByteCode * 0x011af468) line 2417 + 29 bytes
TclObjInterpProcCore(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x00ac0a58, int 1, void (Tcl_Interp *, Tcl_Obj *)* 0x1010085e MakeProcError(Tcl_Interp *, Tcl_Obj *)) line 1763 + 13 bytes
TclObjInterpProc(void * 0x00a882c8, Tcl_Interp * 0x009d8468, int 4, Tcl_Obj * const * 0x009d9430) line 1653 + 22 bytes
TclEvalObjvInternal(Tcl_Interp * 0x009d8468, int 4, Tcl_Obj * const * 0x009d9430, const char * 0xffffffff, int -1, int 0) line 3703 + 27 bytes
TclExecuteByteCode(Tcl_Interp * 0x009d8468, ByteCode * 0x011e1450) line 2417 + 29 bytes
TclObjInterpProcCore(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x00a52498, int 1, void (Tcl_Interp *, Tcl_Obj *)* 0x1010085e MakeProcError(Tcl_Interp *, Tcl_Obj *)) line 1763 + 13 bytes
TclObjInterpProc(void * 0x00a52cf8, Tcl_Interp * 0x009d8468, int 6, Tcl_Obj * const * 0x00a54f20) line 1653 + 22 bytes
TclEvalObjvInternal(Tcl_Interp * 0x009d8468, int 6, Tcl_Obj * const * 0x00a54f20, const char * 0x00000000, int 0, int 0) line 3703 + 27 bytes
Tcl_EvalObjv(Tcl_Interp * 0x009d8468, int 6, Tcl_Obj * const * 0x00a54f20, int 0) line 3901 + 25 bytes
TclEvalObjEx(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x00a52318, int 0, const CmdFrame * 0x00000000, int 0) line 5129 + 21 bytes
Tcl_UplevelObjCmd(void * 0x00000000, Tcl_Interp * 0x009d8468, int 1, Tcl_Obj * const * 0x009d9300) line 945 + 25 bytes
TclEvalObjvInternal(Tcl_Interp * 0x009d8468, int 3, Tcl_Obj * const * 0x009d92f8, const char * 0xffffffff, int -1, int 0) line 3703 + 27 bytes
TclExecuteByteCode(Tcl_Interp * 0x009d8468, ByteCode * 0x00a54a80) line 2417 + 29 bytes
TclObjInterpProcCore(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x00a52498, int 1, void (Tcl_Interp *, Tcl_Obj *)* 0x1010085e MakeProcError(Tcl_Interp *, Tcl_Obj *)) line 1763 + 13 bytes
TclObjInterpProc(void * 0x00a52e18, Tcl_Interp * 0x009d8468, int 6, Tcl_Obj * const * 0x009d9260) line 1653 + 22 bytes
TclEvalObjvInternal(Tcl_Interp * 0x009d8468, int 6, Tcl_Obj * const * 0x009d9260, const char * 0x00000000, int 0, int 524288) line 3703 + 27 bytes
Tcl_EvalObjv(Tcl_Interp * 0x009d8468, int 6, Tcl_Obj * const * 0x009d9260, int 524288) line 3901 + 25 bytes
NsEnsembleImplementationCmd(void * 0x00a51ab0, Tcl_Interp * 0x009d8468, int 7, Tcl_Obj * const * 0x00a53108) line 6235 + 29 bytes
TclEvalObjvInternal(Tcl_Interp * 0x009d8468, int 7, Tcl_Obj * const * 0x00a53108, const char * 0x00000000, int 0, int 0) line 3703 + 27 bytes
Tcl_EvalObjv(Tcl_Interp * 0x009d8468, int 7, Tcl_Obj * const * 0x00a53108, int 0) line 3901 + 25 bytes
TclEvalObjEx(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x00a525a0, int 0, const CmdFrame * 0x00000000, int 0) line 5129 + 21 bytes
Tcl_UplevelObjCmd(void * 0x00000000, Tcl_Interp * 0x009d8468, int 1, Tcl_Obj * const * 0x009d9224) line 945 + 25 bytes
TclEvalObjvInternal(Tcl_Interp * 0x009d8468, int 3, Tcl_Obj * const * 0x009d921c, const char * 0xffffffff, int -1, int 0) line 3703 + 27 bytes
TclExecuteByteCode(Tcl_Interp * 0x009d8468, ByteCode * 0x00a51480) line 2417 + 29 bytes
TclObjInterpProcCore(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x00a4aed0, int 1, void (Tcl_Interp *, Tcl_Obj *)* 0x1010085e MakeProcError(Tcl_Interp *, Tcl_Obj *)) line 1763 + 13 bytes
TclObjInterpProc(void * 0x00a0a830, Tcl_Interp * 0x009d8468, int 7, Tcl_Obj * const * 0x009d9170) line 1653 + 22 bytes
TclEvalObjvInternal(Tcl_Interp * 0x009d8468, int 7, Tcl_Obj * const * 0x009d9170, const char * 0xffffffff, int -1, int 0) line 3703 + 27 bytes
TclExecuteByteCode(Tcl_Interp * 0x009d8468, ByteCode * 0x00a50068) line 2417 + 29 bytes
TclCompEvalObj(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x00a04618, const CmdFrame * 0x00000000, int 0) line 1538 + 13 bytes
TclEvalObjEx(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x00a04618, int 131072, const CmdFrame * 0x00000000, int 0) line 5272 + 21 bytes
Tcl_EvalObjEx(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x00a04618, int 131072) line 5054 + 21 bytes
Tcl_RecordAndEvalObj(Tcl_Interp * 0x009d8468, Tcl_Obj * 0x00a04618, int 131072) line 159 + 22 bytes
Tcl_Main(int -1, char * * 0x009d25d4, int (Tcl_Interp *)* 0x00401005 _Tcl_AppInit) line 553 + 18 bytes
User Comments:
msofer added on 2012-02-15 00:46:44:
Ensemble compiling, TclAdvanceContinuations (TIP 280) ... letting dkf and/or akupries have the first shot

dkf added on 2012-02-15 17:05:06:
I'm not convinced that that branch is well-advised as such, but the bug (in TIP#280-related argument handling in the [dict for] compiler) was real enough. Fixed on 8.5 branch with tests (and ported to 8.6 and your branch).

dkf added on 2012-02-15 17:05:07:

allow_comments - 1

sebres added on 2012-02-15 17:22:00:
> I'm not convinced that that branch is well-advised as such
see Artifact 3475995

dkf added on 2012-02-15 20:43:48:
I will not discuss that matter in _this_ issue.

dgp added on 2013-09-19 02:38:38:
"knownBug" test dict-23.2 points to this ticket.

That test fails for similar reasons that cause this
test to segfault (--enable-symbols=mem to force it
in case you otherwise get lucky):

proc demo {} {tcl::dict::lappend foo bar \
    [format baz]
}
demo

In both cases the wrong final argument values are
getting passed to the CompileWord macros. OBOEs.

dgp added on 2013-09-19 04:29:49:
Both of those examples fixed in the active branches now.

Still lots of CompileWord auditing left to do though.

dgp added on 2013-09-19 19:07:49:
I think I've got them all now.