Bug 828980

Summary: glibc libm regression: 0^-inf is -inf instead of +inf
Product: [Fedora] Fedora Reporter: Michel Lind <michel>
Component: glibcAssignee: Jeff Law <law>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: fweimer, jakub, law, masao-takahashi, pfrankli, schwab
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-14 18:54:29 UTC Type: Bug
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
Test case reproducing the regression none

Description Michel Lind 2012-06-05 17:14:05 UTC
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 Lind 2012-06-05 17:14:54 UTC
(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 18:48:40 UTC
This is due to this upstream patch:

commit 2460d3aa21f04cdf28497683bd3e29183189f779
Author: Joseph Myers <joseph>
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 18:54:29 UTC
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 15:24:31 UTC
BTW, Joseph checked in a fix upstream and I've resyncd Rawhide with the upstream sources.

Comment 5 Michel Lind 2012-06-16 04:34:56 UTC
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 17:35:35 UTC
Just spun a fawhide build this morning which should contain this fix.

Comment 7 Michel Lind 2012-06-19 11:22:51 UTC
Confirmed that the failing test case in pure that originally revealed this bug now passes.