Tcl Source Code

View Ticket
Login
Ticket UUID: 2017162
Title: NRE and debugging tools
Type: Bug Created on: 2008-07-13 09:48:26
Submitter: msofer Assigned to: msofer
Subsystem: 45. Parsing and Eval Severity:
Priority: 8 Last modified: 2010-05-17 21:29:21
Status: Open Closed by:
Resolution: None Closed on:
Version: obsolete: 8.6a1
Description:
NRE possibly messed the bytecode tracing facilities. It will also require further specialized debugging tools to inspect the new stacks (records and callbacks).
User Comments:
kot added on 2009-10-14 04:41:01:
When I compile TclX (from head) against Tcl-8.6b1 and attempt to run TclX' own self-tests, the profile test inevitably crashes inside PushProcCallFrame:

#0  0x08089368 in PushProcCallFrame (clientData=0x96b0f90, interp=0x95c7f90, 
    objc=1, objv=0x95caa70, isLambda=0)
    at /data/mteterin/tcl8.6b1/generic/tclProc.c:1573
#1  0x08089560 in TclNRInterpProc (clientData=0x96b0f90, interp=0x95c7f90, 
    objc=1, objv=0x95caa70) at /data/mteterin/tcl8.6b1/generic/tclProc.c:1683
#2  0x080d9da6 in NRRunObjProc (data=0x96a1b8c, interp=0x95c7f90, result=0)
    at /data/mteterin/tcl8.6b1/generic/tclBasic.c:4303
#3  0x080d9b3b in TclNRRunCallbacks (interp=0x95c7f90, result=0, 
    rootPtr=0x96a1c30, tebcCall=0)
    at /data/mteterin/tcl8.6b1/generic/tclBasic.c:4241
#4  0x080d9737 in Tcl_EvalObjv (interp=0x95c7f90, objc=1, objv=0x95caa70, 
    flags=2097152) at /data/mteterin/tcl8.6b1/generic/tclBasic.c:4024

Apparently, the clientData passed to PushProcCallFrame is now mis-interpreted. It is now the verbatim clientData, that the custom procedure (set by Tcl_CreateTrace). It used to be a different pointer... Because of the mis-interpretation, the procPtr points to TclX' own custom data-structure, rather than anything remotely resembling struct Proc.

This was not the case with 8.5.x

The crash-stack is thus:

#0  0x08089368 in PushProcCallFrame (clientData=0x96b0f90, interp=0x95c7f90, 
    objc=1, objv=0x95caa70, isLambda=0)
    at /data/mteterin/tcl8.6b1/generic/tclProc.c:1573
#1  0x08089560 in TclNRInterpProc (clientData=0x96b0f90, interp=0x95c7f90, 
    objc=1, objv=0x95caa70) at /data/mteterin/tcl8.6b1/generic/tclProc.c:1683
#2  0x080d9da6 in NRRunObjProc (data=0x96a1b8c, interp=0x95c7f90, result=0)
    at /data/mteterin/tcl8.6b1/generic/tclBasic.c:4303
#3  0x080d9b3b in TclNRRunCallbacks (interp=0x95c7f90, result=0, 
    rootPtr=0x96a1c30, tebcCall=0)
    at /data/mteterin/tcl8.6b1/generic/tclBasic.c:4241
#4  0x080d9737 in Tcl_EvalObjv (interp=0x95c7f90, objc=1, objv=0x95caa70, 
    flags=2097152) at /data/mteterin/tcl8.6b1/generic/tclBasic.c:4024
#5  0x080db3a1 in TclEvalEx (interp=0x95c7f90, 
    script=0x970aaa0 "#\n# profile.test\n#\n# Tests for the profile command and profrep procedure.\n#", '-' <repeats 78 times>, "\n# Copyright 1992-1999 Karl Lehenbauer and Mark"..., numBytes=24800, flags=0, line=28)

msofer added on 2010-05-17 19:53:27:
Ooo ... missed that comment completely, sorry kot.

The answer is (I think): TclX uses tcl's internals structures in tclInt.h that are COMPLETELY changed in 8.6. This means that it will not run with 8.6 until it is adapted.

kot added on 2010-05-17 21:29:21:
Miguel, as someone, who knows the changes, could you be troubled to make up a patch for TclX? I will then test it and push into TclX' source (properly ifdef-ed on TCL_VERSION)...

Thank you!