Is LuaJIT intended to be FPU exception safe?

  • From: Niklas Frykholm <niklas@xxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 5 Sep 2012 16:04:32 +0200

I have x87 FPU exceptions enabled when running LuaJIT (to catch
potential bugs, such as scripts dividing by zero or generating NaNs).

This has worked without problems for several months with lots and lots
of Lua code, but today I encountered a legitimate code snippet that
generates a FPU exception in LuaJIT: (running on beta10)

    id = 4713166444560814
    t = {}
    t[id] = 3

  15:38:58.09  [Crash] Float invalid operation (0xc0000090) in build 9747
       0x00d8c576 _lj_BC_TSETV

Is LuaJIT intended to be FPU exception safe, and this exception a bug in LuaJIT?

Or is LuaJIT not intended to be FPU exception safe? Meaning that I
should disable FPU exceptions whenever I call into LuaJIT. (With the
unfortunate consequence that I have no way of detecting floating point
errors in users' scripts.)

// Niklas

Other related posts: