Artifacts Associated With Ticket 1899164fffffffffffffffffffffffffffffffff
Ticket change [d6ec06cb6b] (rid 123893) by dgp on 2008-02-21 21:55:45:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The implementation of Tcl_ExprObj() tries to detect when the Tcl_Obj passed in is a PRECOMPILED "bytecode" value, and then validate interps and forgive any epoch expiration before executing the bytecode. This is incorrect, because a PRECOMPILED value has been compiled as a script to produce the bytecode, and that bytecode is not a valid set of instructions to interpret the same string as an expression. ([eval {0}] and [expr {0}] are different!) Worse still, the cleanup stages at the end of Tcl_ExprObj() will free the bytecode, and since PRECOMPILED values suppress the original string rep., the original bytecode will be lost with no way to recover it. Attached is a patch to make Tcl_ExprObj() do the only sensible thing -- raise an error. No one has noticed this, probably because it appears difficult and unnatural to pass a PRECOMPILED value to Tcl_ExprObj(), possibly even requiring internals intrusion to accomplish it. If there's a way to create a test case for this with reasonable effort in either the Tcl or the tbcload test suite, I'd appreciate that contribution. Otherwise, just review and commit this fix please. - foundin initialized to: "obsolete: 8.5.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: "47. Bytecode Compiler"
- title initialized to: "Tcl_ExprObj and PRECOMPILED scripts"
- type initialized to: "Bug"
Ticket change [5814854798] (rid 117743) by dgp on 2008-02-22 04:55:46:
- icomment:
File Added - 267449: precompexpr.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [f1770a5744] (rid 109367) by dgp on 2008-02-22 22:11:18:
- icomment:
Logged In: YES user_id=80530 Originator: YES The problem is more widespread than I thought: % proc 0+0 {} {return WTF?} % set script { 0+0 } 0+0 % time $script 34 microseconds per iteration % expr $script WTF? - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [e498e2eaa9] (rid 87980) by dgp on 2008-02-22 22:11:19:
- icomment:
File Deleted - 267449:
- login: "dgp"
- mimetype: "text/plain"
- title changed to: "Tcl_ExprObj and cached bytecode"
- username: "dgp"
- icomment:
Ticket change [8fa5ddfcf0] (rid 120312) by dgp on 2008-02-22 22:16:55:
- icomment:
Logged In: YES user_id=80530 Originator: YES % proc 0+0 {} {return WTF?} % set script 0+0 0+0 % time $script 40 microseconds per iteration % expr $script WTF? % append script { } 0+0 % expr $script 0 % time $script 5 microseconds per iteration % expr $script 0 % if 1 $script 0 - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [cc1af8f618] (rid 95637) by dgp on 2008-02-23 00:15:18:
- icomment:
Logged In: YES user_id=80530 Originator: YES I misread the codePtr->refCount management, so I was wrong about the danger of losing the precompiled bytecode. Because cached bytecode is not so transient, the dangers of using the wrong bytecodes do flow both ways.
- login: "dgp"
- mimetype: "text/plain"
- title changed to: "Cached bytecode not typed; expr vs. script"
- username: "dgp"
- icomment:
Ticket change [ad5faa14f5] (rid 101461) by dgp on 2008-02-23 00:36:37:
- assignee changed to: "msofer"
- foundin changed to: "obsolete: 8.4.18"
- icomment:
Logged In: YES user_id=80530 Originator: YES this isn't about tbcload anymore, so assigning to msofer for assistance when he returns.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
Ticket change [58a27ea52b] (rid 117838) by dgp on 2008-03-05 01:52:13:
- icomment:
Logged In: YES user_id=80530 Originator: YES tests committed
- login: "dgp"
- mimetype: "text/plain"
- priority changed to: "8"
- username: "dgp"
- icomment:
Ticket change [8a119deadc] (rid 127328) by dgp on 2008-03-05 01:52:32:
- assignee changed to: "dgp"
Ticket change [a960cd793a] (rid 99139) by dgp on 2008-03-08 02:26:48:
- icomment:
Logged In: YES user_id=80530 Originator: YES Fixed on HEAD for 8.5.2.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [d5ea1d04d3] (rid 123716) by dgp on 2008-03-08 04:08:54:
- closedate changed to: "2008-03-07T21:08:54"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 Originator: YES and fixed for 8.4.19 too.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"