Overview
| Artifact ID: | dd3439f1b70265540938750f20d67d0bdf20d768 |
|---|---|
| Ticket: | 1119369fffffffffffffffffffffffffffffffff
segfault in Tcl_EvalObjv (from Tcl_EvalObjEx call) |
| User & Date: | msofer on 2005-02-11 18:18:14 |
Changes
- icomment:
Logged In: YES user_id=148712 The root of the problem is: TEOE is using (in the pure-list branch) the list internal rep of objPtr as the objv argument to TEOV; if objPtr happens to shimmer away to another internal rep before TEOV returns, objv is freed. If TEOV (or one of its callees!) tries to access objv after that, we get a smash. The correct fix has to be one of: do not use the pure-list branch, or else insure that objv remains valid even if the list shimmers away (as the patch does). Setting TCL_EVAL_DIRECT in the [ns eval] code just avoids the shimmering in this particular case, but does not fix the root problem. In particular, the version included in the new test would still bomb: set SRC [list foo 1] ;# pure-list command proc foo str { # Shimmer pure-list to cmdName and error proc $::SRC {} {}; $::SRC error "BAD CALL" } eval $SRC In you scenario: 1. the shimmering was caused by compilation in [namespace eval ::], which you can indeed avoid by making it use TCL_EVAL_DIRECT 2. the objv access was happening in error handling in TEOV (in trace handlers, for your second example) - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"