Artifacts Associated With Ticket 8c52e7873850438e
Ticket change [5ccebb9f28] (rid 216654) by dgp on 2023-07-21 16:00:54:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-plain"
- comment initialized to:
The dgp-refactor branch has been exhibiting a panic in TclStackFree since the merge of TIP 636 from trunk. Some merge flaw has introduced a defect. Here is a stripped down demo of the panic: proc demo {} { set l {} namespace eval {} {} lappend l a b } demo TclStackFree: incorrect freePtr (0x2489b50 != 0x2489b3f). Call out of sequence? The [set] and [lappend] commands have the effect of getting "l" treated as a compiled local variable. The panicking TclStackFree is one that releases a compiled local previously created with TclStackAlloc. The [namespace eval] seems to be where the corruption happens, and the most likely suspect is in the invokeReplace instruction. Note also that the reported mismatch reports a value of MEMSTART(markerPtr) ending in f, which doesn't seem to be a result with an acceptable alignment, which is supposed to be part of what MEMSTART() does. Very strange symptoms. - is_private initialized to: "0"
- login: "dgp"
- priority initialized to: "5 Medium"
- private_contact initialized to: "8e2300e85be5dd1445b9666eb9429055951e33be"
- resolution initialized to: "None"
- severity initialized to: "Critical"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "47. Bytecode Compiler"
- title initialized to: "dgp-refactor TclStackFree panic"
- type initialized to: "Bug"
Ticket change [4fa66aaac5] (rid 217012) by dgp on 2023-08-03 19:15:25:
- icomment:
Don't understand it yet, but the cause is a call to TclDuplicatePureObj() in the implementation of the INST_LAPPEND_* instructions. Replace that with the old standby Tcl_DuplicateObj() and the panics are gone.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [80e7653ba6] (rid 217013) by dgp on 2023-08-03 19:45:52:
- icomment:
TclDuplicatePureObj() includes a call to Tcl_ConvertToType() When the type is "bytecode", the conversion steps can stomp on the execution stack hanging off the interp. This is a general problem with the bytecode execution engine whenever it calls any function that takes an "interp" argument that might somehow circle back into the execution stack. Any routine like this needs protecting with enclosure in DECACHE_STACK_INFO() ... CACHE_STACK_INFO() I don't know why the panic only showed up on the dgp-refactor branch, but it seems to me the argument for protecting the execution stack would apply on trunk as well. A search through the tickets for CACHE_STACK_INFO should turn up more detailed background information from earlier similar problems. This is a nasty, hard-to-debug design defect that recurs occasionally. A more fundamental design solution would be welcome.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [57dc488b2e] (rid 217016) by dgp on 2023-08-03 19:50:30:
- closedate changed to: "2460160.32673632"
- closer changed to: "dgp"
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"