#72: SIGFPE with no exceptions currently enabled? --------------------+------------------------------------------------------- Reporter: rtoy | Owner: somebody Type: defect | Status: new Priority: major | Milestone: Component: Core | Version: 2013-01 Keywords: | --------------------+------------------------------------------------------- While I've seen this SIGFPE issue before, I never tracked it down. Here is a repeatable case (from Carl): {{{ (defun test (x y) (declare (optimize (speed 3) (safety 0)) (type (signed-byte 32) x y)) (the (signed-byte 32) (truncate x y))) }}} Although the code lies to the compiler (the asserted return type of {{{truncate}}} is incorrect), the point is that {{{(test #x-80000000 -1)}}} causes the SIGFPE exception.
I believe {{{sigfpe-handler}}} was only expecting to handle FP exceptions. In this example, the division causes an overflow which generates the SIGFPE.
#72: SIGFPE with no exceptions currently enabled? ---------------------+------------------------------------------------------ Reporter: rtoy | Owner: somebody Type: defect | Status: closed Priority: major | Milestone: Component: Core | Version: 2013-01 Resolution: fixed | Keywords: ---------------------+------------------------------------------------------ Changes (by toy.raymond@…):
* status: new => closed * resolution: => fixed
Comment:
commit 0174bfebdb2ed8edbdf5b3dade4fd64965d4a9f4 Author: Raymond Toy toy.raymond@gmail.com Date: Thu Jan 31 21:27:36 2013 -0800
Fix ticket:72 : SIGFPE with no exceptions enabled
code/float-trap.lisp:: * In the default case, check FOP to see if it's defined. This means it's a divide exception.
code/x86-vm.lisp:: * Also check to see if the offending instruction is a DIV or IDIV, which means we got an integer overflow. Return the appropriate values in this case.