NetBSD Problem Report #59265

From www@netbsd.org  Mon Apr  7 00:50:15 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 9C90E1A923C
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  7 Apr 2025 00:50:15 +0000 (UTC)
Message-Id: <20250407005014.950191A923E@mollari.NetBSD.org>
Date: Mon,  7 Apr 2025 00:50:14 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: t_strtod:strtod_hex test is failing
X-Send-Pr-Version: www-1.0

>Number:         59265
>Category:       port-vax
>Synopsis:       t_strtod:strtod_hex test is 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:55:00 +0000 2025
>Last-Modified:  Fri Nov 06 16:25:01 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current
>Organization:
The StrtoBSD Vaxination
>Environment:
>Description:
*** Check failed: /tmp/build/2025.04.04.21.52.19-vax/src/tests/lib/libc/stdlib/t_strtod.c:123: end != str + 4: str=0x1190a end=0x1190c
*** Check failed: /tmp/build/2025.04.04.21.52.19-vax/src/tests/lib/libc/stdlib/t_strtod.c:124: d=0=0x0p+0 signbit=0
*** Check failed: /tmp/build/2025.04.04.21.52.19-vax/src/tests/lib/libc/stdlib/t_strtod.c:132: d=0=0x0p+0 signbit=0

https://releng.netbsd.org/b5reports/vax/2025/2025.04.04.21.52.19/test.html#lib_libc_stdlib_t_strtod_strtod_hex

Not sure why strtod is only consuming `-0' and ignoring `x0'.

The sign bit tests are failing because VAX floating-point doesn't have signed zeroes.
>How-To-Repeat:
cd /usr/tests/lib/libc/stdlib
atf-run t_strtod | atf-report
>Fix:
1. Not sure how to fix the first problem, that it consumes only `-0' and not the following `x0'.
2. Conditionalize the signbit tests on whether the machine has signed zeroes.  Or maybe write them as: signbit(d) == signbit(-0.)

>Audit-Trail:
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-vax/59265
Date: Fri, 6 Nov 2026 17:21:57 +0100

 --mUiJJltLYLLTRGHj
 Content-Type: text/plain; charset=utf-8
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable

 Hi!

 This has two sides: First of all, VAX is pre-752 fp and does not know
 about negative zero. And then there is:

 $ cat lib/libc/arch/vax/gdtoa/arith.h
 /* $NetBSD: arith.h,v 1.1 2006/01/25 15:33:28 kleink Exp $ */

 #define VAX
 #define NO_HEX_FP       /* XXX */


 =2E..which disables this feature completely. So "-0x0" is a successfully
 parsed sign, a successful zero (this combination, given that VAX has
 no negative zero is a bad situation by itself---however, this seems to
 be treated as a leading zero, so no actual issue), but then we abort on
 'x' as that's not recognized at all. That we're getting a zero out of
 the double is pure coincidence.

   OTOH, gethex() is there and I think the differences are not too bad
 here. That can be implemented, matching the usual differences (nan,
 inf, signed zero) as reasonable as possible.

 As for the signbit() check, I'd go for skipping them on VAX.

 MfG, JBG

 --=20

 --mUiJJltLYLLTRGHj
 Content-Type: application/pgp-signature; name="signature.asc"

 -----BEGIN PGP SIGNATURE-----

 iF0EABECAB0WIQQlDTvPcScNjKREqWEdvV51g5nhuwUCau3+ogAKCRAdvV51g5nh
 u6DmAJ9WwPj3oKlz19KQoIHw589wcLASaACeOPIUSHJFKHYTF1ZgABjhucrzBvk=
 =cuoz
 -----END PGP SIGNATURE-----

 --mUiJJltLYLLTRGHj--

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.