Bug 3868 - expl(huge negative value) incorrectly signals an OVERFLOW exception
Summary: expl(huge negative value) incorrectly signals an OVERFLOW exception
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: 2.4
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-14 21:46 UTC by Richard B. Kreckel
Modified: 2018-04-20 14:05 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard B. Kreckel 2007-01-14 21:46:36 UTC
For negative long double arguments of huge magnitude, the expl() library
function sets the FPUs OVERFLOW exception flag, in addition to the UNDERFLOW and
INEXACT excpetion flags. This can easily be reproduced by passing a long double
of value -LDBL_MAX as argument. The result is +0.0 exactly, but the OVERFLOW
flag is set. In contrast, exp(-DBL_MAX) onlt sets the UNDERFLOW and INEXACT
floating point exception flags.
Comment 1 Joseph Myers 2012-02-29 00:03:43 UTC
This report does not indicate what architecture was being used, which is important information since there are several different implementations of each libm function in glibc, especially for long double.  Anyway, for current sources with x86 and x86_64 I can confirm the spurious OVERFLOW exception, but don't see the correct UNDERFLOW one.
Comment 2 Joseph Myers 2012-03-28 09:54:22 UTC
Fixed by:

commit 41bf21a1e72c907b1a065727c3b5da43821ca6b0
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Mar 28 09:32:12 2012 +0000

    Avoid overflows from long double functions using __kernel_standard.