NetBSD Problem Report #59261
From www@netbsd.org Sun Apr 6 23:58:44 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits)
client-signature RSA-PSS (2048 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id D37911A9239
for <gnats-bugs@gnats.NetBSD.org>; Sun, 6 Apr 2025 23:58:44 +0000 (UTC)
Message-Id: <20250406235843.442F71A923C@mollari.NetBSD.org>
Date: Sun, 6 Apr 2025 23:58:43 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: t_fpclassify tests are failing
X-Send-Pr-Version: www-1.0
>Number: 59261
>Category: port-vax
>Synopsis: t_fpclassify tests are failing
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-vax-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Apr 07 00:00:00 +0000 2025
>Last-Modified: Tue Apr 08 00:30:01 +0000 2025
>Originator: Taylor R Campbell
>Release: current
>Organization:
The VaxBSD Subnormalization
>Environment:
>Description:
Various t_fpclassify tests are failing related to subnormals, which VAX doesn't have (https://nssdc.gsfc.nasa.gov/nssdc/formats/VAXFloatingPoint.htm, https://pubs.usgs.gov/of/2005/1424/of2005-1424_v1.2.pdf):
*** Check failed: /tmp/build/2025.04.04.21.52.19-vax/src/tests/lib/libc/gen/t_fpclassify.c:145: fpclassify(d1) != FP_SUBNORMAL: [1] fpclassify(0x0p+0)=4 FP_SUBNORMAL=3
*** Check failed: /tmp/build/2025.04.04.21.52.19-vax/src/tests/lib/libc/gen/t_fpclassify.c:148: [1] d1=0x0p+0 d0=0x8p-131
*** Check failed: /tmp/build/2025.04.04.21.52.19-vax/src/tests/lib/libc/gen/t_fpclassify.c:166: e != DBL_MIN_EXP - i: [1] frexp(0x0p+0) returned normalized 0x0p+0, exponent 0; expected normalized 0x8p-4, exponent -128
*** Check failed: /tmp/build/2025.04.04.21.52.19-vax/src/tests/lib/libc/gen/t_fpclassify.c:170: f != 0.5: [1] frexp(0x0p+0) returned normalized 0x0p+0, exponent 0; expected normalized 0x8p-4, exponent -128
*** Check failed: /tmp/build/2025.04.04.21.52.19-vax/src/tests/lib/libc/gen/t_fpclassify.c:145: fpclassify(d1) != FP_SUBNORMAL: [2] fpclassify(0x0p+0)=4 FP_SUBNORMAL=3
...
https://releng.netbsd.org/b5reports/vax/2025/2025.04.04.21.52.19/test.html#lib_libc_gen_t_fpclassify_fpclassify_double
>How-To-Repeat:
cd /usr/tests/lib/libc
atf-run t_fpclassify | atf-report
>Fix:
Looks like this happens because gcc defines __*_HAS_DENORM__ to zero, instead of leaving them undefined:
$ ~/netbsd/current/obj.vax/tooldir/bin/vax--netbsdelf-gcc -dM -x c -E /dev/null | grep DENORM | sort -u
#define __DBL_DENORM_MIN__ ((double)2.93873587705571877e-39L)
#define __DBL_HAS_DENORM__ 0
#define __FLT_DENORM_MIN__ 2.93873587705571877e-39F
#define __FLT_HAS_DENORM__ 0
#define __LDBL_DENORM_MIN__ 2.93873587705571877e-39L
#define __LDBL_HAS_DENORM__ 0
Change
#ifdef __*_HAS_DENORM__
to
#if __*_HAS_DENORM__
everywhere.
>Audit-Trail:
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/59261 CVS commit: src/tests/lib
Date: Mon, 7 Apr 2025 01:31:18 +0000
Module Name: src
Committed By: riastradh
Date: Mon Apr 7 01:31:18 UTC 2025
Modified Files:
src/tests/lib/libc/gen: t_fpclassify.c
src/tests/lib/libm: t_hypot.c t_next.c
Log Message:
tests: Use `#if __*_HAS_DENORM__', not `#ifdef __*_HAS_DENORM__'.
The compiler defines this to zero on, e.g., VAX.
PR port-vax/59261: t_fpclassify tests are failing
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/gen/t_fpclassify.c
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libm/t_hypot.c
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libm/t_next.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/59261 CVS commit: src/tests/lib/libc/gen
Date: Tue, 8 Apr 2025 00:29:09 +0000
Module Name: src
Committed By: riastradh
Date: Tue Apr 8 00:29:09 UTC 2025
Modified Files:
src/tests/lib/libc/gen: t_fpclassify.c
Log Message:
t_fpclassify: Fix build on vax after #if'ing out subnormal tests.
Must've neglected to compile-test this _on vax_, oops.
PR port-vax/59261: t_fpclassify tests are failing
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/gen/t_fpclassify.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.