Subject: Re: 2.0 isn't self-building
To: None <ragge@ludd.luth.se>
From: Tom Ivar Helbekkmo <tih@eunetnorge.no>
List: port-vax
Date: 03/08/2005 08:54:20
<ragge@ludd.luth.se> writes:

>> Program received signal SIGILL, Illegal instruction.
>>
> This is correct behavoiur, NaN on vax is considered an
> illegal value to deal with.  Actually there is no NaN on vax,
> so it is setup to give a trap instead. strtod.c says:
>
> #ifdef VAX
>                 /* Lacking a quiet NaN, build a reserved operand. */
>                 word0(rv) = Sign_bit;
>                 word1(rv) = 0;
> #endif

This has the unintended consequence of making awk crash in a fun way.
I was trying to build pth from pkgsrc just now, as a workaround for
the non-working system pthread library.  It fails because awk dumps
core.  GDB shows us why:

(gdb) where
#0  0x7f78ac38 in strtod (266244, 2147473900) from /usr/lib/libc.so.12
#1  0x00018776 in is_number (266244)
[...]
(gdb) print (char *) 266244
$3 = 0x41004 "nanosleep(const"

So, awk has a function to check whether something is a number -- and
it does it by calling strtod() on the string in question.  If the
string it's looking at happens to start with the letters "nan"...

*grin*

-tih
-- 
Don't ascribe to stupidity what can be adequately explained by ignorance.