Bug 462081

Summary: [RHEL4] Incorrect behaviour of atof() and strtod()
Product: Red Hat Enterprise Linux 4 Reporter: internal.systems
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.9CC: drepper
Target Milestone: rc   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-18 20:34:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Sample program to expose the bug by parsing the string "-0" using strtod() and atof() none

Description internal.systems 2008-09-12 14:43:56 UTC
Description of problem:

Using the string "-0" on functions atof() and strtod() yields the floating point number 0.0 instead of -0.0.

Version-Release number of selected component (if applicable):

glibc-2.3.4-2.41

How reproducible:

Sample program to reproduce the bug is attached.

gcc broken.c -o broken -lm
./broken
  
Actual results:

sscanf -0.000000
strtod 0.000000
atof 0.000000
buf -0


Expected results:

sscanf -0.000000
strtod -0.000000
atof -0.000000
buf -0

Additional info:

Tried this on two up to date RHEL4 boxes, both exhibited the problem.
A RHEL3 box, and a very out of date RHEL4 box did not exhibit the problem.

Comment 1 internal.systems 2008-09-12 14:46:45 UTC
Created attachment 316582 [details]
Sample program to expose the bug by parsing the string "-0" using strtod() and atof()

Comment 3 Jakub Jelinek 2009-01-09 15:40:49 UTC
This was fixed by glibc-strtod--0.patch in RHEL5 glibc-2.5-20 and above.

Comment 9 errata-xmlrpc 2009-05-18 20:34:19 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1017.html