Subject: Very bizarre named coredumps.
To: None <port-i386@NetBSD.ORG>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: port-i386
Date: 10/26/1995 22:18:25
Named has been periodically coredumping on me with SIGFPE.  It is crashing
on line 282 of ns_resp.c, address 0xfc37:

281                             } else
282                                 ns2->d_nstime = ns2->d_nstime * GAMMA;
283     #ifdef DEBUG
284                             if(debug > 1)
285                                 fprintf(ddt, "NS #%d %s rtt now %d\n", n,
286                                     inet_ntoa(qs->ns_addr.sin_addr),

ns2 is a valid pointer, ns2->d_nstime contains 0 (a 32-bit long), and GAMMA
is 0.98.  The instructions around that point:

0xfc18 <ns_resp+2300>:  movl   0xfffffa40(%ebp),%eax
0xfc1e <ns_resp+2306>:  movl   0x14(%eax),%ecx
0xfc21 <ns_resp+2309>:  movl   %ecx,%eax
0xfc23 <ns_resp+2311>:  xorl   %edx,%edx
0xfc25 <ns_resp+2313>:  movl   %eax,0xfffffa1c(%ebp)
0xfc2b <ns_resp+2319>:  movl   %edx,0xfffffa20(%ebp)
0xfc31 <ns_resp+2325>:  fildll 0xfffffa1c(%ebp)
0xfc37 <ns_resp+2331>:  fldl   0xf314
0xfc3d <ns_resp+2337>:  fmulp  %st,%st(1)
0xfc3f <ns_resp+2339>:  fnstcw 0xfffffa50(%ebp)

0xfffffa1c(%ebp) and 0xfffffa20(%ebp) contain 0x00000000; 0xf314 is the
address of a double precision 0.98; 0xfffffa50(%ebp) points to 32 bits of
zeroes (I don't know how long a floating-point control word is).

I can't see any excuse for this failing.  Does anyone have any
suggestions?