NetBSD Problem Report #52368

From martin@duskware.de  Wed Jul  5 08:52:02 2017
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 775827A211
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  5 Jul 2017 08:52:02 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: SIGFPE in compile_rt __floatundidf on vax
X-Send-Pr-Version: 3.95

>Number:         52368
>Category:       lib
>Synopsis:       SIGFPE in compile_rt __floatundidf on vax
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 05 08:55:00 +0000 2017
>Closed-Date:    Sun May 13 17:53:18 +0000 2018
>Last-Modified:  Sun May 13 17:53:18 +0000 2018
>Originator:     Martin Husemann
>Release:        NetBSD 8.99.1
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD dead-to-the-world.duskware.de 8.99.1 NetBSD 8.99.1 (DEAD) #4: Wed Jun 21 20:55:19 CEST 2017 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/vax/compile/DEAD vax
Architecture: vax
Machine: vax
>Description:

Trying to build perl on vax fails:

Core was generated by `perl'.
Program terminated with signal SIGFPE, Arithmetic exception.
#0  0x7f4ccbfb in __floatundidf (a=272487529377788, 1919217660, 63443)
    at /work/src/sys/external/bsd/compiler_rt/dist/lib/builtins/floatundidf.c:47
47      /work/src/sys/external/bsd/compiler_rt/dist/lib/builtins/floatundidf.c:
(gdb) bt
#0  0x7f4ccbfb in __floatundidf (a=272487529377788, 1919217660, 63443)
    at /work/src/sys/external/bsd/compiler_rt/dist/lib/builtins/floatundidf.c:47
#1  0x7f6c0f2e in Perl_drand48_r (2133864428)
   from /usr/pkgobj/lang/perl5/work/perl-5.26.0/libperl.so
#2  0x7f6c11e5 in Perl_get_hash_seed (2133862400, 2138877952)
   from /usr/pkgobj/lang/perl5/work/perl-5.26.0/libperl.so
#3  0x7f662240 in perl_construct (2133862400)
   from /usr/pkgobj/lang/perl5/work/perl-5.26.0/libperl.so
#4  0x00010c6c in main (6, 2147477828, 2147477856)
(gdb) x/16i __floatundidf
   0x7f4ccbd2 <__floatundidf>:  halt
   0x7f4ccbd3 <__floatundidf+1>:        halt
   0x7f4ccbd4 <__floatundidf+2>:        subl2 $0x4,sp
   0x7f4ccbd7 <__floatundidf+5>:        bisl3 $0x00006a80,0x8(ap),r0
   0x7f4ccbe0 <__floatundidf+14>:       clrf r1
   0x7f4ccbe2 <__floatundidf+16>:       subd2 $0x0000008000006a80 [d-float],r0
   0x7f4ccbed <__floatundidf+27>:       bisl3 $0x00005a80,0x4(ap),r2
   0x7f4ccbf6 <__floatundidf+36>:       clrf r3
   0x7f4ccbf8 <__floatundidf+38>:       addd2 r2,r0
=> 0x7f4ccbfb <__floatundidf+41>:       ret
(gdb) info reg
r0             0xffd3   65491
r1             0x20000000       536870912
r2             0x7264fffc       1919221756
r3             0x0      0
r4             0x7264effc       1919217660
r5             0xf7d3   63443
r6             0x7f7cb000       2138877952
r7             0x7f302800       2133862400
r8             0x7f7cb005       2138877957
r9             0x7f302fec       2133864428
r10            0x7f7cb008       2138877960
r11            0x0      0
ap             0x7fffe850       2147477584
fp             0x7fffe83c       2147477564
sp             0x7fffe838       2147477560
pc             0x7f4ccbfb       2135739387
ps             0x3c00004        62914564

I guess we are trying to add the two double values in r0/r1 to r2/r3
and get an overflow or something. Can gdb easily display these as double?
I only know about /f format:

(gdb) print/f $r0    
$3 = -1.40233554e+38
(gdb) print/f $r2
$5 = -1.67779703e+38

and adding those would be too big:

#define __DBL_MAX__ ((double)1.70141183460469229e+38L)
#define __DBL_MAX_10_EXP__ 38


>How-To-Repeat:
s/a

>Fix:
n/a

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sun, 13 May 2018 17:53:18 +0000
State-Changed-Why:
floatundidf is no longer built on vax, and given the additional perl-related bugs, compilation does succeed and the result works.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.