Overview
| Artifact ID: | 08f20683aa0ff0affb590ec0ed801a9c3149ec5d |
|---|---|
| Ticket: | 1061224fffffffffffffffffffffffffffffffff
"expr sqrt(-1)" crash with EXCEPTION_FLT_INVALID_OPERATION |
| User & Date: | davygrvy on 2004-11-05 22:32:45 |
Changes
- assignee changed to: "kennykb"
- cmimetype changed to: "text/plain"
- comment changed to:
Stack trace: KERNEL32! RaiseException MSVCRTD! _raise_exc MSVCRTD! _87except MSVCRTD! _startOneArgErrorHandling MSVCRTD! sqrt TclExecuteByteCode TclCompEvalObj Tcl_EvalObjEx NamespaceEvalCmd Tcl_NamespaceObjCmd TclEvalObjvInternal TclExecuteByteCode TclCompEvalObj Tcl_EvalObjEx Tcl_CatchObjCmd TclEvalObjvInterna TclExecuteByteCode Tcl_ExprObj Tcl_ExprBooleanObj Tcl_IfObjCmd TclEvalObjvInternal Tcl_EvalEx Tcl_Eva fake_Tcl_Eval The script I asked it to eval was "expr sqrt(-1)". When my fake_Tcl_Eval() modifies the registers as you suggested, the app killing exception 0xC0000090 is avoided: int fake_Tcl_Eval (Tcl_Interp *interp, char *string) { Tcl_DString dst; int result; Tcl_DStringInit(&dst); // ensure no upper ascii character combos look like // UTF-8 start codes. // Tcl_ExternalToUtfDString(XiRCEncoding, string, -1, &dst); int mask = _controlfp( 0, 0 ); // Some math functions need to be protected from raising // exceptions: /tcl expr sqrt(-1) _controlfp( _CW_DEFAULT, _MCW_EM ); result = Tcl_Eval(interp, Tcl_DStringValue(&dst)); _controlfp( mask, _MCW_EM ); Tcl_DStringFree(&dst); return result; } Can Tcl assume the responsibility of protecting it's own math calls by this method rather than the client of the API? - foundin changed to: "obsolete: 8.5a2"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "davygrvy"
- subsystem changed to: "50. Embedding Support"
- title changed to:
math functions can cause unwanted exceptions and termination
- type changed to: "Bug"