Port-vax archive

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

Re: Libm core dump with SIGILL

On 2015-08-21 15:41, Paul Koning wrote:

On Aug 21, 2015, at 9:29 AM, Greg Stark <stark%mit.edu@localhost> wrote:

On Fri, Aug 21, 2015 at 2:24 PM, Johnny Billquist <bqt%update.uu.se@localhost> wrote:

SIGILL is a compiler bug (if the implementation of exp() is in C) or a
programmer error (if it's in assembler).

We should check this. There is trickery going on with VAX FP, in order to
somewhat achieve some of the similar properties of IEEE FP. I know that have
bitten me in the past, and it might even be needed to check in gcc itself,
as the actual libraries might not even be invoked.

Sorry, I should have included the versions of things

This is on a freshly installed NetBSD 6.1.5 on simh from a recently
checked out git tree:

simh# uname -a
NetBSD simh 6.1.5 NetBSD 6.1.5 (GENERIC) vax

simh# gcc --version
gcc (GCC) 4.1.3 20080704 prerelease (NetBSD nb3 20111107)

$ ./vax -h
MicroVAX 3900 simulator V4.0-0 Beta        git commit id: f3af74e4

The backtrace is actually a bit deeper than just exp()

#0  0x7f7b6984 in infnan (34) from /usr/lib/libm.so.0
#1  0x7f7b6810 in scalb (16512, 1179648, 17406, 0) from /usr/lib/libm.so.0
#2  0x7f7b66df in exp (255017904, 735823842) from /usr/lib/libm.so.0

Ok.  It's intentional, but I would call this a design error.  Look at libm/arch/vax/n_infnan.S, it ends in an explicit "reserved operand" error.  Why anyone would do that rather than generating the exception intended for this purpose (floating point error) is unclear.

Well, at least it is as I suspected/had some vague memory of.
Just NaNs and INF are tricky. The semantics under IEEE cannot be properly done on a VAX, so it was decided to do it like this. I don't remember the reasoning right now, but I'm sure we could recreate it, or else someone like Matt or Ragge can jump in, if they actually do remember this...

The (silly) thing is that IEEE can have NaNs passed around just fine, and it will not trap or complain or anything. You will only get a trap if you actually do some operation on them. And you can also represent +INF and -INF, and you can also do some operations on those. The VAX just don't have that. So it becomes a question of how to deal with things.


Home | Main Index | Thread Index | Old Index