Floating point traps are triggered by alien code.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| SBCL |
Undecided
|
Unassigned |
Bug Description
When making foreign function calls (with sb-alien or a wrapper such as cffi), sbcl will trap floating point errors that happen in the C code, and by default sbcl traps on errors that aren't typically on in c code (the default mode in C99 is to be in nonstop mode, ie no fp exceptions trigger a SIGFPE).
This means that foreign function calls need to be wrapped in sb-int:
SBCL should probably make foreign function calls with the floating point environment set to the default.
Gábor Melis (melisgl) wrote : Re: [Bug 1519630] [NEW] Floating point traps are triggered by alien code. | #1 |
Vinced (vincezd) wrote : | #2 |
It affects us on the IUP library: https:/
```
#+sbcl
(sb-int:
(:divide-
(callback))
```
Michał "phoe" Herda (phoe-krk) wrote : | #3 |
Also visible in cl-opengl - https:/
Stas Boukarev (stassats) wrote : | #4 |
What is visible in cl-opengl? That "SBCL should probably make foreign function calls with the floating point environment set to the default." will make everything slow?
ender <email address hidden> writes:
> This means that foreign function calls need to be wrapped in sb-int traps-masked or clear traps with sb-ing: set-floating- point-
> :with-float-
> modes. Both of which are awkward and tricky to use portably.
>
> SBCL should probably make foreign function calls with the floating point
> environment set to the default.
+1 from user's point of view.