|
2024-08-28
| ||
| 13:42 | • Ticket [db4f2843cd] Sporadic segfault (BO) using tclIO status still Closed w... artifact: a4eb53a04d user: pooryorick | |
|
2019-08-28
| ||
| 14:42 | • Closed ticket [fa6bf38d07]: Execution of byte-code with recompile in-between bre... artifact: 48154af919 user: sebres | |
|
2019-08-27
| ||
| 18:27 | closes [fa6bf38d07]: integrate bug-fa6bf38d07-v2 check-in: 35c83160d6 user: sebres tags: core-8-6-branch | |
| 15:42 | • Ticket [fa6bf38d07] Execution of byte-code with recompile in-between breaks norm... artifact: e8d99ff297 user: sebres | |
| 15:03 | • Pending ticket [fa6bf38d07]. artifact: d1ce072aee user: sebres | |
| 15:00 | fixes [fa6bf38d07]: command invocation (NRE callback to TEBCResume) caused by execution of recompile... closed check-in: a03e05de6e user: sebres tags: bug-fa6bf38d07 | |
| 12:12 | • Ticket [fa6bf38d07] Execution of byte-code with recompile in-between breaks norm... artifact: 70779b90fa user: sebres | |
| 12:03 | added tests covering bug [fa6bf38d07] check-in: f7ece56ca2 user: sebres tags: bug-fa6bf38d07 | |
| 11:11 | • Ticket [fa6bf38d07] Execution of byte-code with recompile in-between breaks norm... artifact: 0c823c9bfd user: sebres | |
|
2019-08-26
| ||
| 19:58 | • Ticket [fa6bf38d07]: 3 changes artifact: 1607a466bb user: dgp | |
| 17:01 | • Ticket [fa6bf38d07]: 4 changes artifact: 674036341f user: sebres | |
| 15:41 | • Ticket [fa6bf38d07]: 3 changes artifact: 59edf89f80 user: sebres | |
| 14:44 | • Ticket [fa6bf38d07]: 3 changes artifact: 8978ea9d2b user: sebres | |
| 14:03 | • Ticket [fa6bf38d07]: 3 changes artifact: 1dc600aad5 user: sebres | |
| 14:02 | • New ticket [fa6bf38d07]. artifact: 3e1359e670 user: sebres | |
Execution of byte-code with recompile in-between breaks normal execution flow (e. g. disregards "return" or "break" commands).
PoC:
set i [interp create]
$i eval {proc _recompile_ {} {rename set __set; rename __set set}}
$i eval {puts A; puts B; return; puts C}
$i eval {puts A; _recompile_; puts B; return; puts C}
The last eval does not return before puts C.
35c83160d6closes [fa6bf38d07]: integrate bug-fa6bf38d07-v2 check-in2019-08-27 18:27:05a03e05de6efixes [fa6bf38d07]: command invocation (NRE callback to TEBCResume) caused by execution of recompiled TEBC (on epoch bump) check-in2019-08-27 15:00:44f7ece56ca2added tests covering bug [fa6bf38d07] check-in2019-08-27 12:03:51
This is also not slave (interp-command) related issue, same with in main-interp within tclsh (compiled Tcl_RecordAndEval):
Just strange, the issue is not reproducible at all with
proc _recompile_ {} {rename set __set; rename __set set}
puts A; _recompile_; puts B; return; puts C
if 1 {puts A; _recompile_; puts B; return; puts C}
set i 0; while {[incr i] < 10} {puts A; _recompile_; puts B; return; puts C}
eval, namespace eval/inscope ::, or if invoked like a proc.
It looks like the issue is not restricted to "returnImm" instruction.
Trying to check command "break" issued with:
As assumed it seems to be NRE (because 8.5 was not affected), so possibly [c718302fcab3892c] causes that (so ISC peephole, e. g. NRE-related switch to direct invocation, is implemented not correct, or it got broken later with some further commits).
% set i 0; while {[incr i] < 10} { puts A; _recompile_; puts B; break; puts C }
A
B
invoked "break" outside of a loop"
A piece of the puzzle is the special handling of exceptional return codes when (interp->numLevels == 0). The restarted evaluation of a recompile is probably not recreating the same value of that field as the first pass.
Sure, just I think it is rather an after effect (looks like a continuation with direct execution, resp. GetSrcInfoForPc() starts retriving from wrong current command)...
So for some reason in case of a while-loop (without a break), bumping of epoch causes "direct" execution starting from incr i, not by puts B.
So it is called firstly after whole single iteration (while-body) is processed.
Also debugging of other cases shows strange continuation points in instStartCmdFailed.
There is possibly a related issue [723a2f4ac3]
Should be fixed now in branch bug-fa6bf38d07.
After small review I provided another variant as bug-fa6bf38d07-v2, with a simplification (used the same "fixed" (and faster) code for INST_EVAL_STK).