From archie@FreeBSD.org  Tue Oct  1 13:21:02 2002
Return-Path: <archie@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2A42D37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  1 Oct 2002 13:21:02 -0700 (PDT)
Received: from beast.freebsd.org (beast.freebsd.org [216.136.204.28])
	by mx1.FreeBSD.org (Postfix) with ESMTP id DEAF843E6E
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  1 Oct 2002 13:21:01 -0700 (PDT)
	(envelope-from archie@FreeBSD.org)
Received: from beast.freebsd.org (localhost [127.0.0.1])
	by beast.freebsd.org (8.12.6/8.12.6) with ESMTP id g91KL1j6032895
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 1 Oct 2002 13:21:01 -0700 (PDT)
	(envelope-from archie@beast.freebsd.org)
Received: (from archie@localhost)
	by beast.freebsd.org (8.12.6/8.12.6/Submit) id g91KL1Ec032894;
	Tue, 1 Oct 2002 13:21:01 -0700 (PDT)
Message-Id: <200210012021.g91KL1Ec032894@beast.freebsd.org>
Date: Tue, 1 Oct 2002 13:21:01 -0700 (PDT)
From: Archie Cobbs <archie@FreeBSD.org>
Reply-To: Archie Cobbs <archie@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: strtod() core dumps
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         43567
>Category:       alpha
>Synopsis:       strtod() core dumps
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    robert
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 01 13:30:02 PDT 2002
>Closed-Date:    Tue May 24 13:53:48 GMT 2005
>Last-Modified:  Tue May 24 14:10:02 GMT 2005
>Originator:     Archie Cobbs
>Release:        FreeBSD 5.0-CURRENT alpha
>Organization:
Packet Design
>Environment:
System: FreeBSD beast.freebsd.org 5.0-CURRENT FreeBSD 5.0-CURRENT #32: Mon Sep 23 14:10:02 PDT 2002 peter@beast.freebsd.org:/usr/src/sys/alpha/compile/BEAST alpha

>Description:
	The strtod() function barfs when given certain inputs.

>How-To-Repeat:

Compile this program and run the commands below:

----------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <errno.h>
#include <err.h>

#define INPUT	"5e-324"

int
main(int ac, char **av)
{
	const char *ascii = INPUT;
	double value;

	switch (ac) {
	case 1:
		break;
	case 2:
		ascii = av[1];
		break;
	default:
		errx(1, "usage: strtod-test [string]");
	}
	printf("input is \"%s\"\n", ascii);
	printf("result: ");

	/* Parse double value */
	errno = 0;
	value = strtod(ascii, NULL);
	if (errno == ERANGE) {
		if (value == 0.0) {
			printf("underflow\n");
			return (0);
		}
		if (value == HUGE_VAL || value == -HUGE_VAL) {
			printf("overflow\n");
			return (0);
		}
	}

	printf("value is %g\n", value);
	return (0);
}
----------------------------------------------------------------------


	$ cc -Wall -o xx xx.c
	$ ./xx 5e-304
	input is "5e-304"
	Floating exception (core dumped)

>Fix:

	?

>Release-Note:
>Audit-Trail:

From: John Baldwin <jhb@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org,
	Archie Cobbs <archie@FreeBSD.org>
Cc:  
Subject: Re: alpha/43567: strtod() core dumps
Date: Wed, 06 Nov 2002 13:50:43 -0500 (EST)

 Is this a duplicate of 12623 and 17032?
 
 -- 
 
 John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
 "Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

From: Archie Cobbs <archie@dellroad.org>
To: John Baldwin <jhb@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: alpha/43567: strtod() core dumps
Date: Wed, 6 Nov 2002 18:34:41 -0800 (PST)

 John Baldwin writes:
 > Is this a duplicate of 12623 and 17032?
 
 Looks pretty similar to those. Only analysis of the code (or fixing
 the bug and testing) would tell for sure of course, but most likely
 they're all part of the same underlying bug.
 
 -Archie
 
 __________________________________________________________________________
 Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com
State-Changed-From-To: open->patched 
State-Changed-By: robert 
State-Changed-When: Sun Nov 17 08:51:00 PST 2002 
State-Changed-Why:  
A fix was committed to -CURRENT. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=43567 
Responsible-Changed-From-To: freebsd-alpha->robert 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sat Jul 12 16:36:22 PDT 2003 
Responsible-Changed-Why:  
Robert reported that a fix was committed 

http://www.freebsd.org/cgi/query-pr.cgi?pr=43567 

From: Sten Spans <sten@blinkenlights.nl>
To: bug-followup@FreeBSD.org, archie@FreeBSD.org
Cc:  
Subject: Re: alpha/43567: strtod() core dumps
Date: Tue, 24 May 2005 09:24:13 +0200 (CEST)

 This seems to have been fixed, please close the PR.
 
 <sten@deepthought:~> uname -a
 FreeBSD deepthought.blinkenlights.nl 6.0-CURRENT FreeBSD 6.0-CURRENT #4: 
 Mon May  9 22:44:34 CEST 2005 
 root@deepthought.blinkenlights.nl:/usr/obj/usr/src/sys/DEEPTHOUGHT  alpha
 <sten@deepthought:~> gcc -Wall -o bla bla.c
 <sten@deepthought:~> ./bla 5e-304
 input is "5e-304"
 result: value is 5e-304
 
 
 -- 
 Sten Spans
 
 "There is a crack in everything, that's how the light gets in."
 Leonard Cohen - Anthem
State-Changed-From-To: patched->closed 
State-Changed-By: archie 
State-Changed-When: Tue May 24 13:53:33 GMT 2005 
State-Changed-Why:  
Bug is fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=43567 

From: Archie Cobbs <archie@dellroad.org>
To: Sten Spans <sten@blinkenlights.nl>
Cc: bug-followup@freebsd.org
Subject: Re: alpha/43567: strtod() core dumps
Date: Tue, 24 May 2005 08:54:14 -0500

 Sten Spans wrote:
 > This seems to have been fixed, please close the PR.
 
 I closed it.
 
 -Archie
 
 __________________________________________________________________________
 Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
>Unformatted:
