Skip to content
Tcl Source Code History Of Ticket a0ece9d6d449ed4a
Login

History Of Ticket a0ece9d6d449ed4a

Artifacts Associated With Ticket a0ece9d6d449ed4a

  1. Ticket change [55a637a037] (rid 142338) by anonymous on 2015-07-01 14:07:44:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. 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.
      
    5. foundin initialized to: "8.6.x"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "8e6ce392c4d8186f2a85d6745cb17142d2c7e7f0"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "46. Traces"
    15. title initialized to:
      execution trace on source command crashes when executing clock scan
      
    16. type initialized to: "Bug"
  2. Ticket change [15f27e464a] (rid 142340) by oehhar on 2015-07-02 07:06:49:

    1. 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
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  3. Ticket change [2a1d6c7a50] (rid 142371) by anonymous on 2015-07-02 08:57:11:

    1. 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
      
    2. login: "anonymous"
    3. mimetype: "text/plain"
  4. Ticket change [cff2207ac5] (rid 142376) by anonymous on 2015-07-02 10:47:15:

    1. 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.
      
    2. login: "anonymous"
    3. mimetype: "text/plain"
  5. Ticket change [48d785f7d7] (rid 142412) by dgp on 2015-07-02 13:41:32:

    1. assignee changed to: "dgp"
    2. 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
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "7 High"
  6. Ticket change [9e70f3fa59] (rid 142417) by dgp on 2015-07-02 16:08:49:

    1. icomment:
      
      Current problems originate with:
      
      http://core.tcl.tk/tcl/info/2f5ee8efad801
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  7. Ticket change [36da907629] (rid 142418) by dgp on 2015-07-02 19:49:42:

    1. 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.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  8. Ticket change [916c071c3c] (rid 142419) by dgp on 2015-07-05 16:53:14:

    1. closedate changed to: "2457209.20364268"
    2. closer changed to: "dgp"
    3. icomment:
      
      Fixed with a test on trunk.
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
  9. Ticket change [c4e2ced153] (rid 142440) by anonymous on 2015-07-07 08:33:58:

    1. closedate changed to: "2457210.85693039"
    2. closer changed to: "anonymous"
    3. icomment: "Works for me now. Thank you."
    4. login: "anonymous"
    5. mimetype: "text/plain"