Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Oct 2002 16:37:23 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        Archie Cobbs <archie@freebsd.org>
Cc:        freebsd-alpha@freebsd.org
Subject:   Re: alpha/43567: strtod() core dumps
Message-ID:  <15770.1923.354337.452249@grasshopper.cs.duke.edu>
In-Reply-To: <200210012021.g91KL1Ec032894@beast.freebsd.org>
References:  <200210012021.g91KL1Ec032894@beast.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Archie,

Can you try rebuilding libc with -miee?

Eg:

.if ${MACHINE_ARCH} == "alpha"
CFLAGS += -mieee
.endif


I think that should probably go into bsd.lib.mk

People might complain becase that slows down fp operations, but if
people care about performance, they should really be using the compaq
libm anyhow.

Drew

Archie Cobbs writes:
 > 
 > >Number:         43567
 > >Category:       alpha
 > >Synopsis:       strtod() core dumps
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    freebsd-alpha
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Tue Oct 01 13:30:02 PDT 2002
 > >Closed-Date:
 > >Last-Modified:
 > >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:
 > >Unformatted:
 > 
 > To Unsubscribe: send mail to majordomo@FreeBSD.org
 > with "unsubscribe freebsd-alpha" in the body of the message

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15770.1923.354337.452249>