NetBSD Problem Report #45020

From jruohone@gmail.com  Sat Jun  4 09:52:18 2011
Return-Path: <jruohone@gmail.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 49FEE63BA4F
	for <gnats-bugs@gnats.netbsd.org>; Sat,  4 Jun 2011 09:52:18 +0000 (UTC)
Message-Id: <20110604095212.2E0D056C5@marx.bitnet>
Date: Sat,  4 Jun 2011 12:52:12 +0300 (EEST)
From: Jukka Ruohonen <jruohonen@iki.fi>
Sender: a b <jruohone@gmail.com>
Reply-To: jruohonen@iki.fi
To: gnats-bugs@gnats.NetBSD.org
Subject: strtold(3) does not detect NaN
X-Send-Pr-Version: 3.95

>Number:         45020
>Category:       lib
>Synopsis:       strtold(3) does not detect NaN
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 04 09:55:00 +0000 2011
>Closed-Date:    Wed Jul 13 05:32:25 +0000 2011
>Last-Modified:  Wed Jul 13 05:32:25 +0000 2011
>Originator:     Jukka Ruohonen
>Release:        5.99.52
>Organization:
-
>Environment:
amd64

>Description:

The saga of strtod(3) bugs continues: the long double variant does not
detect NaN on amd64.

>How-To-Repeat:

	...

	long double ld;

	ld = strtold("NaN", NULL);

	if (isnan(ld) == 0)
		printf("fail");

	...

>Fix:

Unknown.

>Release-Note:

>Audit-Trail:
From: "Jukka Ruohonen" <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45020 CVS commit: src/tests/lib/libc/stdlib
Date: Sat, 4 Jun 2011 09:57:34 +0000

 Module Name:	src
 Committed By:	jruoho
 Date:		Sat Jun  4 09:57:33 UTC 2011

 Modified Files:
 	src/tests/lib/libc/stdlib: t_strtod.c

 Log Message:
 Verify PR lib/45020. Fails at least on amd64.


 To generate a diff of this commit:
 cvs rdiff -u -r1.12 -r1.13 src/tests/lib/libc/stdlib/t_strtod.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, lib-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: lib/45020: strtold(3) does not detect NaN
Date: Sat, 4 Jun 2011 06:51:46 -0400

 On Jun 4,  9:55am, jruohonen@iki.fi (Jukka Ruohonen) wrote:
 -- Subject: lib/45020: strtold(3) does not detect NaN

 | >Description:
 | 
 | The saga of strtod(3) bugs continues: the long double variant does not
 | detect NaN on amd64.
 | 
 | >How-To-Repeat:
 | 
 | 	...
 | 
 | 	long double ld;
 | 
 | 	ld = strtold("NaN", NULL);
 | 
 | 	if (isnan(ld) == 0)
 | 		printf("fail");
 | 
 | 	...

 Looks like a compiler bug to me. Either use -ffloat-store, or call isnanl()
 directly.

 christos

From: Jukka Ruohonen <jruohonen@iki.fi>
To: Christos Zoulas <christos@zoulas.com>
Cc: gnats-bugs@NetBSD.org
Subject: Re: lib/45020: strtold(3) does not detect NaN
Date: Sat, 4 Jun 2011 13:56:36 +0300

 On Sat, Jun 04, 2011 at 06:51:46AM -0400, Christos Zoulas wrote:
 > Looks like a compiler bug to me. Either use -ffloat-store, or call isnanl()
 > directly.

 You mean __isnanl()? It fails also with it.

 - Jukka.

From: christos@zoulas.com (Christos Zoulas)
To: jruohonen@iki.fi
Cc: gnats-bugs@NetBSD.org
Subject: Re: lib/45020: strtold(3) does not detect NaN
Date: Sat, 4 Jun 2011 10:21:40 -0400

 On Jun 4,  1:56pm, jruohonen@iki.fi (Jukka Ruohonen) wrote:
 -- Subject: Re: lib/45020: strtold(3) does not detect NaN

 | On Sat, Jun 04, 2011 at 06:51:46AM -0400, Christos Zoulas wrote:
 | > Looks like a compiler bug to me. Either use -ffloat-store, or call isnanl()
 | > directly.
 | 
 | You mean __isnanl()? It fails also with it.

 No I mean isnanl(), although I don't see it defined anywhere, it seems
 to work. Anyway, fix forthcoming.

 christos

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/45020: strtold vs. NAN
Date: Tue, 7 Jun 2011 15:54:53 +0200

 This all, of course, is highly MD. Sparc64 gets it right, for example.

 Martin

State-Changed-From-To: open->closed
State-Changed-By: jruoho@NetBSD.org
State-Changed-When: Wed, 13 Jul 2011 05:32:25 +0000
State-Changed-Why:

This was fixed, thanks.



>Unformatted:

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.