Bug 10846 - libm pow() function does not report floating point underflow exception
Summary: libm pow() function does not report floating point underflow exception
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-26 09:56 UTC by Mike Frysinger
Modified: 2014-07-01 05:33 UTC (History)
2 users (show)

See Also:
Host: x86_64-linux-gnu
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
test.c (305 bytes, text/plain)
2009-10-26 09:56 UTC, Mike Frysinger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Frysinger 2009-10-26 09:56:26 UTC
first reported here:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/429113

The pow() function in the standard C library does not report a floating point 
underflow exception like it is supposed to.

Compile the attached program with '-O0 -fno-bultin-pow -lm'. Then run it.

some people report correct behavior on x86 but not on x86_64
Comment 1 Mike Frysinger 2009-10-26 09:56:42 UTC
Created attachment 4319 [details]
test.c
Comment 2 Joseph Myers 2012-03-06 21:07:11 UTC
Confirmed with current sources on x86_64.
Comment 3 Joseph Myers 2012-04-08 21:45:29 UTC
Appears to be caused by a GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52907
Comment 4 Joseph Myers 2012-05-06 12:41:10 UTC
Now fixed, presumably by:

commit bd7b0e561f7f684cedfc4adb964569fe9ab16209
Author: Andreas Jaeger <aj@suse.de>
Date:   Sun May 6 09:14:15 2012 +0200

    Build glibc with -frounding-math
    
        * Makeconfig (+math-flags): New, set to -frounding-math.
        (+cflags): Add +math-flags so that all of glibc gets compiled with
        it.

Should be closed as fixed once libm-test.inc supports testing underflow exceptions and an appropriate test has been added.
Comment 5 Joseph Myers 2012-05-24 15:38:45 UTC
Testcase added by:

commit 7a25eb06bfa838900bef78b975c38aa7e012b587
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu May 24 15:36:54 2012 +0000

    Add tests for underflow exception bugs 10846, 14036.