Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Libm core dump with SIGILL

Greg Stark skrev den 2015-08-21 14:35:
While running the Postgres regression tests I found that the exp()
function in libm gets a SIGILL with certain arguments.

simh$  gcc -Wall  exp.c -lm
simh$ ./a.out
[4]   Illegal instruction (core dumped) ./a.out

On a modern architecture with IEEE floats:

$ gcc -Wall  exp.c -lm
$ ./a.out
exp(88.0297) = 1.70141e+38

I know the VAX floating points are not exactly IEEE and they may not
be able to represent this value but I would expect them to get a FPE
or signal overflow in some other way, not get a SIGILL?
Well, not in VAX FP.  From the man page for exp:

These functions will return the appropriate computation unless an error occurs or an argument is out of range. The functions exp() and expm1() detect if the computed value will overflow, set the global variable errno
     to ERANGE and cause a reserved operand fault on a VAX.

So, it is following the specs... :-)

-- Ragge

Home | Main Index | Thread Index | Old Index