Summary: | Bogus FPE on underflow for exp(double) | ||
---|---|---|---|
Product: | glibc | Reporter: | law |
Component: | math | Assignee: | Aurelien Jarno <aurelien> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aurelien, rjrw |
Priority: | P2 | Flags: | fweimer:
security-
|
Version: | 2.15 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | testcase |
This should be fixed by: http://sourceware.org/ml/libc-alpha/2012-02/msg00299.html This is a different bug than the one fixed by the link I gave above. 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 kernel_standard in both places, the test program runs through without problems. Patches posted on: http://sourceware.org/ml/libc-alpha/2012-02/msg00446.html I have committed this patch as: commit f77f12320635155da728a3c1adb75ff9914cf686 Author: Aurelien Jarno <aurelien@aurel32.net> Date: Sun Apr 8 22:45:13 2012 +0000 Use __kernel_standard instead of __kernel_standard_f in exp wrapper (bug 13705). and the obvious testcase patch for it as: commit d2de7579f257386ba5c28dfca94fa8aef143b4e0 Author: Joseph Myers <joseph@codesourcery.com> Date: Sun Apr 8 22:46:49 2012 +0000 Do not allow overflow exception on exp underflow test (bug 13705). |
Created attachment 6225 [details] testcase With floating point trapping enabled, *except* for "underflow" and "inexact", exp(-1.0e40) will throw a Floating Point Exception. How reproducible: Every time. Steps to Reproduce: 1. Compile attached test programme (g++ test1.cpp) 2. Run program 3. Actual results: Floating point exception. Expected results: The value 0 should be printed.