Overview
| Artifact ID: | 1384f2aa79f067eeee29d1d9204fa6efe47f8af9 |
|---|---|
| Ticket: | 2152286fffffffffffffffffffffffffffffffff
TCL_RETURN causes TclUpdateReturnInfo() to panic |
| User & Date: | fadib on 2008-10-07 22:39:05 |
Changes
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- comment changed to:
Please see the attached testcase (tcltest.tar.gz) Problem Analysis: ---------------- The problem happens when a C function calls a TCL proc that calls a C function that returns TCL_RETURN, this causes returnLevel to be decremented all the way to 0 causing TclUpdateReturnInfo() to panic. Testcase: -------- + (tcltest.c): main() calls CProcCmd() function which is a C function with a TCL wrapper. + CProcCmd() calls tclproc (tcltest.tcl) which calls CProcCmd() again. + CProcCmd() returns TCL_RETURN which makes TCL panic. Workarounds: ----------- There are two workarounds that I can use to make the testcase work (uncomment either line 25 or 28 in tcltest.c): + Workaround 1 (line 25): Explicitly increment returnLevel before returning TCL_RETURN. + Workaround 2 (line 28): Call a dummy tcl proc before returning TCL_RETURN. This works because it forces the returllevel to be incremented once and thus stops it from ever reaching 0.
- foundin changed to: "obsolete: 8.5.4"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "fadib"
- subsystem changed to: "45. Parsing and Eval"
- title changed to: "TCL_RETURN causes TclUpdateReturnInfo() to panic"
- type changed to: "Bug"