Current-Users archive

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

Re: build failure (alpha-current): floating point exception 8



On Mon, Mar 02, 2009 at 12:29:57PM +0000, Christos Zoulas wrote:
> In article <20090302110553.GA274304%medusa.sis.pasteur.fr@localhost>,
> Nicolas Joly  <njoly%pasteur.fr@localhost> wrote:
> >On Sun, Mar 01, 2009 at 11:08:02PM +0000, Christos Zoulas wrote:
> >> In article <86sklwyhov.wl%kazumi%mse.biglobe.ne.jp@localhost>,
> >> FURUSAWA Kazumi  <kazumi%mse.biglobe.ne.jp@localhost> wrote:
> >> >Hi, all,
> >> >
> >> >build error deteced as below:
> >> >
> >> >/usr/local/NetBSD-current/tooldir/bin/alpha--netbsd-nm -go librump.a |
> >> >/usr/local/NetBSD-current/tooldir/bin/nbawk '     
> >> >$NF!~/^(rump|RUMP|__|_GLOBAL_OFFSET_TABLE'')/  {printf "%s rumpns_%s\n",
> >> >$NF, $NF}'  | sort | uniq  > renametab.librump.a
> >> >/usr/local/NetBSD-current/tooldir/bin/nbawk: floating point exception 8
> >> > input record number 1989, file 
> >> > source line number 1
> >> >/usr/local/NetBSD-current/tooldir/bin/alpha--netbsd-objcopy
> >> >--redefine-syms renametab.librump.a librump.a
[...]
> >> This will hide the problem, because a signal will not be generated, but
> >> there could be a zero divide or an overflow. I will make the error message
> >> more informative...
> >
> >There is, at least, a zero divide error :
> >
> >[...]
> >      build  libsyspuffs/librumpfs_syspuffs_pic.a
> >/local/src/NetBSD/tool/bin/nbawk: floating point exception: Floating
> >point divide by zero
> > input record number 435, file
> > source line number 1
> >    compile  libsyspuffs/puffs_rumpglue.o
> >      build  libsyspuffs/librumpfs_syspuffs.so.0.0
> >      build  libsyspuffs/librumpfs_syspuffs.a
> >/local/src/NetBSD/tool/bin/nbawk: floating point exception: Floating
> >point divide by zero
> > input record number 435, file
> > source line number 1
> >    compile  liblfs/lfs_vfsops.po
> >[...]
> 
> So the next step is to add some printfs to the awk script to track this down.

I tracked it to the following nm output line :

  `librumpvfs_pic.a:vfs_syscalls.so:                 U nanotime'

njoly@thanos [~/tmp]> /local/src/NetBSD/tool/bin/nbawk '$NF!~/^rump/' 1.out
/local/src/NetBSD/tool/bin/nbawk: floating point exception: Floating point 
divide by zero

 input record number 1, file 1.out
 source line number 1

This small testcase produce 3 user traps on my alpha :

CPU 0    trap entry = 0x3 (instruction fault)
CPU 0    a0         = 0x0
CPU 0    a1         = 0x1600e8d50
CPU 0    a2         = 0x160251b58
CPU 0    pc         = 0x160045dc4
CPU 0    ra         = 0x160047124
CPU 0    pv         = 0x160045dc0
CPU 0    curlwp     = 0xfffffc001245b800
CPU 0        pid = 19664, comm = nbawk

CPU 0    trap entry = 0x3 (instruction fault)
CPU 0    a0         = 0x0
CPU 0    a1         = 0x1600e8d50
CPU 0    a2         = 0x160251b58
CPU 0    pc         = 0x160047128
CPU 0    ra         = 0x160047124
CPU 0    pv         = 0x160045dc0
CPU 0    curlwp     = 0xfffffc001245b800
CPU 0        pid = 19664, comm = nbawk

CPU 0    trap entry = 0x1 (arithmetic trap)
CPU 0    a0         = 0x2
CPU 0    a1         = 0x40000000000
CPU 0    a2         = 0x2
CPU 0    pc         = 0x120011004
CPU 0    ra         = 0x120010fd4
CPU 0    pv         = 0x1601ee380
CPU 0    curlwp     = 0xfffffc001245b800
CPU 0        pid = 19664, comm = nbawk

The last one, seems to comes from strtod returning NaN which is the
compared to a huge number ...

njoly@thanos [~/tmp]> gdb /local/src/NetBSD/tool/bin/nbawk 
GNU gdb 6.5
[...]
This GDB was configured as "alpha--netbsd"...
(gdb) run '$NF!~/^rump/' 1.out
Starting program: /local/src/NetBSD/tool/bin/nbawk '$NF!~/^rump/' 1.out
[...]
Program received signal SIGFPE, Arithmetic exception.
0x0000000120011004 in is_number (s=0x160308024 "nanotime")
    at /local/src/NetBSD/src/dist/nawk/lib.c:713
713             if (ep == s || r == HUGE_VAL || errno == ERANGE)
(gdb) p ep
$2 = 0x160308027 "otime"
(gdb) p s
$3 = 0x160308024 "nanotime"
(gdb) p r
$4 = nan(0x8000000000000)
(gdb) p errno
$5 = 0
(gdb) l
708     {
709             double r;
710             char *ep;
711             errno = 0;
712             r = strtod(s, &ep);
713             if (ep == s || r == HUGE_VAL || errno == ERANGE)
714                     return 0;
715             while (*ep == ' ' || *ep == '\t' || *ep == '\n')
716                     ep++;
717             if (*ep == '\0')

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.


Home | Main Index | Thread Index | Old Index