TclCheckExecutionTraces incompatible with Tcl_TraceCommand
Closed1337941fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2005-10-26 00:08:26
TclCheckExecutionTraces() assumes that
tracePtr->clientData points to a TraceCommandInfo
struct. This is not the case if, say,
Tcl_TraceCommand() was called to set up a trace from
user code.
Example: User code calls
Tcl_TraceCommand(interp,"list",TCL_TRACE_RENAME,traceProc,(ClientData)NULL);
and then, from the interpreter:
proc >> args {puts [info level 0]}
trace add execution list enter >>
list
This leads to a segfault in TclCheckExecutionTraces().
A solution that appears to work for me is to make the
assumption above only when tracePtr->traceProc ==
TraceCommandProc.
Patch against CVS version 1.26 of tclTrace.c is attached.
jhdvplain2005-10-26 07:08:32
File Added - 153779: tclTrace.diff
dgpplain2005-11-02 02:46:41
Logged In: YES user_id=80530 Here's the same patch in the more customary format.
dgpplain2005-11-02 02:47:10
File Added - 154690: 1337941.patch
dgpplain2005-11-02 02:51:26
Logged In: YES user_id=80530 Here's the corresponding patch for Tcl 8.4 branch
dgpplain2005-11-02 02:51:49
File Added - 154691: 1337941-84.patch
dgpplain2005-11-02 03:19:31
Logged In: YES user_id=80530 Patches committed. Bug fixed for Tcl 8.4.12 and 8.5a4. Thanks for the report and the fix!
jhdv Closed ticket [1337941fff].
[History diff]2005-11-02 07:57:50
Log in (anonymous is fine) to add a comment.
Attachments:
- 1337941-84.patch [download] added by dgp on 2005-11-02 02:51:28. [details]
- 1337941.patch [download] added by dgp on 2005-11-02 02:46:41. [details]
- tclTrace.diff [download] added by jhdv on 2005-10-26 07:08:26. [details]