Bug 828980 - glibc libm regression: 0^-inf is -inf instead of +inf
glibc libm regression: 0^-inf is -inf instead of +inf
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
rawhide
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Jeff Law
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-05 13:14 EDT by Michel Alexandre Salim
Modified: 2016-11-24 11:13 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-14 14:54:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test case reproducing the regression (216 bytes, application/octet-stream)
2012-06-05 13:14 EDT, Michel Alexandre Salim
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 14241 None None None Never

  None (edit)
Description Michel Alexandre Salim 2012-06-05 13:14:05 EDT
Created attachment 589588 [details]
Test case reproducing the regression

Description of problem:
ISO/IEC 9899:TC3, Annex F.9.4.4 specifies that pow(0, -INFINITY) is inf, as it is in F-17's glibc-2.15-37.fc17.x86_64; however, in Rawhide's glibc, the same calculation returns -inf -- as tested by compiling the attached test case (either on F-17 or Rawhide) and running it with one glibc or the other.

Version-Release number of selected component (if applicable):
glibc-2.15.90-6.fc18.x86_64

How reproducible:
Always

Steps to Reproduce:
1. glibc -lm -o powtest powtest.c
  
Actual results:
pow(0.0, -INFINITY) = -inf (positive? 0)

Expected results:
pow(0.0, -INFINITY) = inf (positive? 1)

Additional info:
Noticed during a rebuild of Pure; test case provided by Pure author:
http://code.google.com/p/pure-lang/issues/detail?id=72
Comment 1 Michel Alexandre Salim 2012-06-05 13:14:54 EDT
(In reply to comment #0)
> Steps to Reproduce:
> 1. glibc -lm -o powtest powtest.c
>
That should be gcc -lm -o powtest powtest.c, of course.
Comment 2 Jeff Law 2012-06-14 14:48:40 EDT
This is due to this upstream patch:

commit 2460d3aa21f04cdf28497683bd3e29183189f779
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Mar 21 12:14:57 2012 +0000

    Fix pow of zero and infinity to large powers.
Comment 3 Jeff Law 2012-06-14 14:54:29 EDT
I'm going to let Joseph handle it upstream.  We'll pick up the fix via our normal merging processes.
Comment 4 Jeff Law 2012-06-15 11:24:31 EDT
BTW, Joseph checked in a fix upstream and I've resyncd Rawhide with the upstream sources.
Comment 5 Michel Alexandre Salim 2012-06-16 00:34:56 EDT
Could you update the bug tracker once there's a build on Koji I can test? The latest build is from June 13th and predates this fix. Thanks!
Comment 6 Jeff Law 2012-06-18 13:35:35 EDT
Just spun a fawhide build this morning which should contain this fix.
Comment 7 Michel Alexandre Salim 2012-06-19 07:22:51 EDT
Confirmed that the failing test case in pure that originally revealed this bug now passes.

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