Bug 760935 - Bogus FPE on underflow for exp(double)
Summary: Bogus FPE on underflow for exp(double)
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 16
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Jeff Law
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2011-12-07 11:36 UTC by Roderick Johnstone
Modified: 2016-11-24 15:46 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-02-17 21:10:38 UTC
Type: ---

Attachments (Terms of Use)
Test program showing floating point exception (866 bytes, text/x-c++src)
2011-12-07 11:36 UTC, Roderick Johnstone
no flags Details

Description Roderick Johnstone 2011-12-07 11:36:55 UTC
Created attachment 541903 [details]
Test program showing floating point exception

Description of problem:
On Fedora 16, with floating point trapping enabled, *except* for "underflow" and "inexact", exp(-1.0e40) will throw a Floating Point Exception.

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

How reproducible:
Every time.

Steps to Reproduce:
1. Compile attached test programme (g++ test1.cpp)
2. Run program
Actual results:
Floating point exception.

Expected results:
The value 0 should be printed.

Additional info:
On Fedora 14 the test program gives the expected result "0" so this is a regression in Fedora 16.

At lines 35 and 40 of w_exp.c, libm uses the floating point variant "kernel_standard_f" rather than the double variant "kernel_standard".

The implementation of kernel_standard_f in k_standard.c just maps double to float (for arguments and return value).  If kernel_standard_f is changed to to kernel_standard in both places, the test program runs through without problems.

Comment 1 Jeff Law 2012-02-17 21:10:38 UTC
Bug reported upstream.  If/when the upstream maintainers fix this bug we will incorporate the fix as part of our regular Fedora development process.


Comment 2 Jeff Law 2012-02-24 17:42:29 UTC
FWIW, I went ahead and pulled the proposed upstream patch into rawhide and f17.

Comment 3 Roderick Johnstone 2012-02-24 18:56:02 UTC
I'd really appreciate this in F16 if thats possible too.

Comment 4 Jeff Law 2012-02-24 19:31:46 UTC
I'm not likely to spin it.  My time is very limited and my focus is much more on preparations for f17, particularly finding a couple pthread deadlocks that are affecting multiple packages.

Note You need to log in before you can comment on or make changes to this bug.