NetBSD Problem Report #50937

From www@NetBSD.org  Fri Mar 11 03:07:04 2016
Return-Path: <www@NetBSD.org>
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" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 186037ABDA
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 11 Mar 2016 03:07:04 +0000 (UTC)
Message-Id: <20160311030703.2374F7ACA1@mollari.NetBSD.org>
Date: Fri, 11 Mar 2016 03:07:03 +0000 (UTC)
From: sibnick@gmail.com
Reply-To: sibnick@gmail.com
To: gnats-bugs@NetBSD.org
Subject: incorrect printf result for subnormal long double values
X-Send-Pr-Version: www-1.0

>Number:         50937
>Category:       lib
>Synopsis:       incorrect printf result for subnormal long double values
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 11 03:10:00 +0000 2016
>Closed-Date:    Sun Mar 13 20:20:05 +0000 2016
>Last-Modified:  Sun Mar 13 20:20:05 +0000 2016
>Originator:     Tolstokulakov Nikolay
>Release:        7.0
>Organization:
nsu.ru
>Environment:
NetBSD netbsd.home 7.0 NetBSD 7.0 (GENERIC.201509250726Z) amd64
>Description:
Unexpected and wrong result when print subnormal long double value

SO question & answer http://stackoverflow.com/questions/35090322/netbsd-long-double-trouble
>How-To-Repeat:
 #include <stdio.h>

 int main()
 {
      long double rd = 3.3621e-4932L;
      printf("%Le\n", rd);
      // NetBSD prints 1.681050e-4932
      return 0;
 }
>Fix:

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/50937: incorrect printf result for subnormal long double values
Date: Fri, 11 Mar 2016 11:56:58 +0100

 Note: this is amd64 specific and still the same in -current. It works
 on sparc64.

 Martin

From: henning petersen <henning.petersen@t-online.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: lib/50937: incorrect printf result for subnormal long double
 values
Date: Sun, 13 Mar 2016 17:57:49 +0100

 This is a multi-part message in MIME format.
 --------------070403030503020503060100
 Content-Type: text/plain; charset=utf-8; format=flowed
 Content-Transfer-Encoding: 7bit

 With this patch it works on amd64.
 Problem has been solved in FreeBSD PR: 85080.

 --------------070403030503020503060100
 Content-Type: text/plain; charset=UTF-8;
  name="ldtoa.c.diff"
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment;
  filename="ldtoa.c.diff"

 ZGlmZiAtdSAtcCAtcjEuNCBsZHRvYS5jCi0tLSBsaWIvbGliYy9nZHRvYS9sZHRvYS5jCTIz
 IEZlYiAyMDA3IDE3OjQ1OjU5IC0wMDAwCTEuNAorKysgbGliL2xpYmMvZ2R0b2EvbGR0b2Eu
 YwkxMyBNYXIgMjAxNiAxMzoxMjowOSAtMDAwMApAQCAtODcsOSArODcsNyBAQCBsZHRvYShs
 b25nIGRvdWJsZSAqbGQsIGludCBtb2RlLCBpbnQgbmRpCiAJCWJyZWFrOwogCWNhc2UgRlBf
 U1VCTk9STUFMOgogCQlraW5kID0gU1RSVE9HX0Rlbm9ybWFsOwotI2lmZGVmCUxEQkxfSU1Q
 TElDSVRfTkJJVAogCQliZSsrOwotI2VuZGlmCiAJCWJyZWFrOwogCWNhc2UgRlBfSU5GSU5J
 VEU6CiAJCWtpbmQgPSBTVFJUT0dfSW5maW5pdGU7Cg==
 --------------070403030503020503060100--

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50937 CVS commit: src/lib/libc/gdtoa
Date: Sun, 13 Mar 2016 15:44:58 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Sun Mar 13 19:44:58 UTC 2016

 Modified Files:
 	src/lib/libc/gdtoa: ldtoa.c

 Log Message:
 PR/50937: Henning Petersen: Fix subnormal printf for long double x86. From
 FreeBSD PR 85080.


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.5 src/lib/libc/gdtoa/ldtoa.c

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

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sun, 13 Mar 2016 20:20:05 +0000
State-Changed-Why:
Fixed by christos, thanks.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.