Subject: lib/14040: regress in lib/libc/ieeefp/except strangely fails
To: None <gnats-bugs@gnats.netbsd.org>
From: None <wiz@netbsd.org>
List: netbsd-bugs
Date: 09/22/2001 02:09:45
>Number:         14040
>Category:       lib
>Synopsis:       regress in lib/libc/ieeefp/except strangely fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 21 18:10:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Klausner
>Release:        1.5Y/20010921
>Organization:
not enough
>Environment:
	
System: NetBSD hiro 1.5Y NetBSD 1.5Y (HIRO) #0: Fri Sep 21 22:58:00 CEST 2001 wiz@hiro:/archive/cvs/src/sys/arch/i386/compile/HIRO i386
Architecture: i386
Machine: i386
>Description:
``make regress'' in regress/lib/libc/ieeefp/except fails:
root@hiro:/usr/src/regress/lib/libc/ieeefp/except> make distclean
rm -f a.out [Ee]rrs mklog core *.core  except except.o  except.ln
rm -f except.cat1
rm -f .depend /usr/src/regress/lib/libc/ieeefp/except/tags
root@hiro:/usr/src/regress/lib/libc/ieeefp/except> make regress
cc -O2  -Werror   -nostdinc -idirafter /build/usr/include -c /usr/src/regress/lib/libc/ieeefp/except/except.c
cc   -o except -nostdlib -Wl,-rpath-link,/build/usr/lib /build/usr/lib/crt0.o /build/usr/lib/crtbegin.o except.o  -L/build/usr/lib -lgcc -lc -lgcc /build/usr/lib/crtend.o
./except
*** Signal 4

Stop.
make: stopped in /usr/src/regress/lib/libc/ieeefp/except

Running the binary directly gives:
root@hiro:/usr/src/regress/lib/libc/ieeefp/except> obj.i386/except
Illegal instruction (core dumped)

Running it (compiled with CFLAGS=-g, -> no -O2) in gdb gives:
root@hiro:/usr/src/regress/lib/libc/ieeefp/except> gdb obj.i386/except
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsd"...
(gdb) r
Starting program: /archive/cvs/src/regress/lib/libc/ieeefp/except/obj.i386/except

Program received signal SIGFPE, Arithmetic exception.
0x48098640 in __assert13 ()
(gdb) c
Continuing.
assertion "signal_caught == 1" failed: file "/usr/src/regress/lib/libc/ieeefp/except/except.c", line 60, function "main"

Program received signal SIGABRT, Aborted.
0x480d80eb in kill ()
(gdb)

When setting a breakpoint in 59, and `step'ping from there, I can
reach the last line, and the program exits with error code 0.

When setting a breakpoint in 59, doing one 'step' and then
'c'ontinuing (twice), the assert in line 66 fails.

When setting another breakpoint in 65, doing one 'step' and then
'c'ontinuing (twice), the assert in line 72 fails.

This can be repeated for the assert in line 78.
>How-To-Repeat:
See above.

In case it matters:
cpu0: AMD K6-2 (586-class), 400.92 MHz
cpu0: I-cache 32 KB 32b/line 2-way, D-cache 32 KB 32b/line 2-way
cpu0: features 8021bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8>
cpu0: features 8021bf<PGE,MMX>
>Fix:
Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted: