Artifacts Associated With Ticket a0ece9d6d449ed4a
Ticket change [55a637a037] (rid 142338) by anonymous on 2015-07-01 14:07:44:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
On Windows 7, I'm trying to debug scripts using execution traces on the source command. This works well to a great extent, but when the script executes the 'clock scan' command Tcl crashes. Here's the minimalistic code that shows it: clockscan.tcl: clock scan 1980-01-01 In tclsh: % proc enterStep args { puts "enter" } % proc leaveStep args { puts "leave" } % trace add execution source enterstep enterStep % trace add execution source leavestep leaveStep % source clockscan.tcl <many enter/leave msgs> Crash! This happens in all of the following: - tclsh and wish of ActiveState Tcl 8.6.1.0 installation (threaded) - tclsh and wish built from Tcl 8.6.4 sources, both debug and release (threaded) Stacktrace from my own debug build: msvcr120d.dll!0f5731ca() Unknown [Frames below may be incorrect and/or missing, no symbols loaded for msvcr120d.dll] > tcl86tg.dll!TclNRRunCallbacks(Tcl_Interp * interp, int result, NRE_callback * rootPtr) Line 4392 C tcl86tg.dll!Tcl_EvalObjv(Tcl_Interp * interp, int objc, Tcl_Obj * const * objv, int flags) Line 4123 C tcl86tg.dll!TclEvalEx(Tcl_Interp * interp, const char * script, int numBytes, int flags, int line, int * clNextOuter, const char * outerScript) Line 5262 C tcl86tg.dll!TclSubstTokens(Tcl_Interp * interp, Tcl_Token * tokenPtr, int count, int * tokensLeftPtr, int line, int * clNextOuter, const char * outerScript) Line 2277 C tcl86tg.dll!TclEvalEx(Tcl_Interp * interp, const char * script, int numBytes, int flags, int line, int * clNextOuter, const char * outerScript) Line 5150 C tcl86tg.dll!Tcl_FSEvalFileEx(Tcl_Interp * interp, Tcl_Obj * pathPtr, const char * encodingName) Line 1815 C tcl86tg.dll!Tcl_FSEvalFile(Tcl_Interp * interp, Tcl_Obj * pathPtr) Line 1711 C tcl86tg.dll!Tcl_EvalFile(Tcl_Interp * interp, const char * fileName) Line 427 C If I record the frame info in the enterStep then I see that it stops in clock.tcl at line 1391 (in tcl::clock::FreeScan). Note that for now I have a workaround that renames clock and executes it in a slave interpreter. - foundin initialized to: "8.6.x"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- private_contact initialized to: "8e6ce392c4d8186f2a85d6745cb17142d2c7e7f0"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "46. Traces"
- title initialized to:
execution trace on source command crashes when executing clock scan
- type initialized to: "Bug"
Ticket change [15f27e464a] (rid 142340) by oehhar on 2015-07-02 07:06:49:
- icomment:
I have tried you code with the current trunk (2015-07-01) and it did not crash: <verbatim> wish8.6 ... leave 315529200 (bin) 7 % </verbatim> clock package is pure TCL, so it is an issue in the interpreter, which might already be fixed. Could you verify that ? Thank you, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [2a1d6c7a50] (rid 142371) by anonymous on 2015-07-02 08:57:11:
- icomment:
Thanks for the prompt reply. I have downloaded the .zip from GitHub and built it. The original example I provided works now. That's great. However, I still get a crash if I change the enter proc code to this: % proc enter args { puts "[info frame [expr [info frame] - 2]]" } It panics with an error "LocSearch failure". Stack trace: > tcl86tg.dll!Tcl_PanicVA(const char * format, char * argList) Line 115 C tcl86tg.dll!Tcl_Panic(const char * format, ...) Line 153 C tcl86tg.dll!TclGetSrcInfoForPc(CmdFrame * cfPtr) Line 9957 C tcl86tg.dll!TclInfoFrame(Tcl_Interp * interp, CmdFrame * framePtr) Line 1341 C tcl86tg.dll!InfoFrameCmd(void * dummy, Tcl_Interp * interp, int objc, Tcl_Obj * const * objv) Line 1228 C tcl86tg.dll!Dispatch(void * * data, Tcl_Interp * interp, int result) Line 4360 C tcl86tg.dll!TclNRRunCallbacks(Tcl_Interp * interp, int result, NRE_callback * rootPtr) Line 4393 C tcl86tg.dll!Tcl_EvalObjv(Tcl_Interp * interp, int objc, Tcl_Obj * const * objv, int flags) Line 4123 C tcl86tg.dll!TclEvalEx(Tcl_Interp * interp, const char * script, int numBytes, int flags, int line, int * clNextOuter, const char * outerScript) Line 5263 C tcl86tg.dll!Tcl_EvalEx(Tcl_Interp * interp, const char * script, int numBytes, int flags) Line 4927 C tcl86tg.dll!Tcl_Eval(Tcl_Interp * interp, const char * script) Line 5856 C tcl86tg.dll!TraceExecutionProc(void * clientData, Tcl_Interp * interp, int level, const char * command, Tcl_Command_ * cmdInfo, int objc, Tcl_Obj * const * objv) Line 1892 C tcl86tg.dll!TclCheckInterpTraces(Tcl_Interp * interp, const char * command, int numChars, Command * cmdPtr, int code, int traceFlags, int objc, Tcl_Obj * const * objv) Line 1614 C tcl86tg.dll!TEOV_RunEnterTraces(Tcl_Interp * interp, Command * * cmdPtrPtr, Tcl_Obj * commandPtr, int objc, Tcl_Obj * const * objv) Line 4717 C tcl86tg.dll!EvalObjvCore(void * * data, Tcl_Interp * interp, int result) Line 4271 C tcl86tg.dll!TclNRRunCallbacks(Tcl_Interp * interp, int result, NRE_callback * rootPtr) Line 4393 C tcl86tg.dll!TclEvalObjEx(Tcl_Interp * interp, Tcl_Obj * objPtr, int flags, const CmdFrame * invoker, int word) Line 5959 C tcl86tg.dll!Tcl_EvalObjEx(Tcl_Interp * interp, Tcl_Obj * objPtr, int flags) Line 5940 C tcl86tg.dll!Tcl_RecordAndEvalObj(Tcl_Interp * interp, Tcl_Obj * cmdPtr, int flags) Line 190 C tcl86tg.dll!Tcl_MainExW(int argc, unsigned short * * argv, int (Tcl_Interp *) * appInitProc, Tcl_Interp * interp) Line 535 C tclsh86tg.exe!wmain(int argc, unsigned short * * argv) Line 129 C tclsh86tg.exe!__tmainCRTStartup() Line 623 C tclsh86tg.exe!wmainCRTStartup() Line 466 C kernel32.dll!7737337a() Unknown [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll] ntdll.dll!77b292e2() Unknown ntdll.dll!77b292b5() Unknown Could you try to reproduce this? TIA, Hans - login: "anonymous"
- mimetype: "text/plain"
- icomment:
Ticket change [cff2207ac5] (rid 142376) by anonymous on 2015-07-02 10:47:15:
- icomment:
Some additional info: if I 'catch' the puts statement the crash disappears: % proc enter args { catch { puts "[info frame [expr [info frame -2]]"} } % source clockscan.tcl ... Works fine in the current trunk. But still crashes in the other version where I found the original problem. - login: "anonymous"
- mimetype: "text/plain"
- icomment:
Ticket change [48d785f7d7] (rid 142412) by dgp on 2015-07-02 13:41:32:
- assignee changed to: "dgp"
- icomment:
[source] is not essential. Simplified demo: proc e args {info frame [expr [info frame] - 2]} proc demo {} {clock scan 1980-01-01} trace add execution demo enterstep e demo - login: "dgp"
- mimetype: "text/plain"
- priority changed to: "7 High"
Ticket change [9e70f3fa59] (rid 142417) by dgp on 2015-07-02 16:08:49:
- icomment:
Current problems originate with: http://core.tcl.tk/tcl/info/2f5ee8efad801
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [36da907629] (rid 142418) by dgp on 2015-07-02 19:49:42:
- icomment:
Simpler still: proc demo {} {expr {rand()}} trace add execution demo enterstep {apply {args {info frame -2}}} demo Key is to be tracing the execution of an [expr] function call, and to request just the right frame. - login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [916c071c3c] (rid 142419) by dgp on 2015-07-05 16:53:14:
- closedate changed to: "2457209.20364268"
- closer changed to: "dgp"
- icomment:
Fixed with a test on trunk.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [c4e2ced153] (rid 142440) by anonymous on 2015-07-07 08:33:58:
- closedate changed to: "2457210.85693039"
- closer changed to: "anonymous"
- icomment: "Works for me now. Thank you."
- login: "anonymous"
- mimetype: "text/plain"