Bug 59826

Summary: library functions give floating point exceptions
Product: [Retired] Red Hat Linux Reporter: Robert M. Riches Jr. <rm.riches>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: alpha   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-02-13 18:15:42 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
C program source
none
compilation script that shows the problem
none
compilation script that shows a workaround none

Description Robert M. Riches Jr. 2002-02-13 18:13:29 UTC
Description of Problem:
    The default math libraries give floating point exceptions
    when doing fairly ordinary things, such as exp(-709.0) and
    then using the result.

Version-Release number of selected component (if applicable):
    glibc-devel-2.2.4-19.3

How Reproducible:
    100%

Steps to Reproduce:
1. In a C program, do exp(-709.0) and then use the result.
   (Sample source code as an attachment.)
2. 
3. 

Actual Results:
    Floating exception

Expected Results:
    The result should be a usable FP number somewhere near
    or equal to zero.

Additional Information:
    It appears the exp() function is returning a denormalized
    number, and later use of this number causes an exception.
    I had seen this issue and worked around it by using -mieee
    in the Rainbow information retrieval package, either the
    Festival speech synthesis package or the Phoenix speech
    recognition package, and xlock (-mode invert).  However,
    on advice from experts on the axp-list mailing list, I now
    consider it a library bug.

Comment 1 Robert M. Riches Jr. 2002-02-13 18:14:12 UTC
Created attachment 45563 [details]
C program source

Comment 2 Robert M. Riches Jr. 2002-02-13 18:14:57 UTC
Created attachment 45565 [details]
compilation script that shows the problem

Comment 3 Robert M. Riches Jr. 2002-02-13 18:15:35 UTC
Created attachment 45566 [details]
compilation script that shows a workaround

Comment 4 Jakub Jelinek 2002-02-13 20:02:20 UTC
There is just one libm and is not multilibbed, so you really cannot have both
precise results for -mieee and flushing to zero for non-mieee at the same time.
I'd suggest using -mieee always (e.g. the whole RHL alpha distribution is
compiled that way), or before using return values from libm functions wrapping
them in some function which flushes them to zero.