[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
This bug was fixed in the package eglibc - 2.15-0ubuntu10.3 --- eglibc (2.15-0ubuntu10.3) precise; urgency=low * Backport fixes for dbl-64 and ldbl-128 issues (LP: #1000498) * Backport another FMA support patch from glibc master branch. eglibc (2.15-0ubuntu10.2) precise-security; urgency=low * SECURITY UPDATE: stack buffer overflow in vfprintf handling (LP: #1031301) - debian/patches/any/CVE-2012-3406.patch: switch to malloc when array grows too large to handle via alloca extension - CVE-2012-3406 * SECURITY UPDATE: stdlib strtod integer/buffer overflows - debian/patches/any/CVE-2012-3480.patch: rearrange calculations and modify types to void integer overflows - CVE-2012-3480 eglibc (2.15-0ubuntu10.1) precise; urgency=low * Backport fix from 2.16 to fix htons() conversion errors on non-x86 architectures, by correctly casting to uint16_t (LP: #1016349) * Restore missing AT_EMPTY_PATH definition in fnctl.h (LP: #1010069) * Backport FMA4/AVX detection from glibc 2.16 (LP: #956051, #979003) * Backport fixups to AVX-using code to match the detection backport. * Backport fix from 2.16 for sscanf/realloc deadlock (LP: #1028038) * Backport for bogus FPE on underflow for exp(double) (LP: #1007457) -- Adam Conrad adcon...@ubuntu.com Wed, 03 Oct 2012 15:58:02 -0600 ** Changed in: eglibc (Ubuntu Precise) Status: Fix Committed = Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
its verified, please release it :) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
Verified with the test-case that this is fixed in precise-proposed. ** Tags removed: verification-needed ** Tags added: verification-done -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
Unsubscribing sponsors. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
Hello Thomas, or anyone else affected, Accepted eglibc into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/eglibc/2.15-0ubuntu10.3 in a few hours, and then in the -proposed repository. Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users. If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision. Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance! ** Changed in: eglibc (Ubuntu Precise) Status: In Progress = Fix Committed ** Tags added: verification-needed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
This bug was fixed in the package eglibc - 2.15-0ubuntu20 --- eglibc (2.15-0ubuntu20) quantal; urgency=low * Backport fixes for dbl-64 and ldbl-128 issues (LP: #1000498) * Backport another FMA support patch from glibc master branch. eglibc (2.15-0ubuntu19) quantal-proposed; urgency=low * SECURITY UPDATE: stack buffer overflow in vfprintf handling (LP: #1031301) - debian/patches/any/CVE-2012-3406.patch: switch to malloc when array grows too large to handle via alloca extension - CVE-2012-3406 * SECURITY UPDATE: stdlib strtod integer/buffer overflows - debian/patches/any/CVE-2012-3480.patch: rearrange calculations and modify types to void integer overflows - CVE-2012-3480 -- Adam Conrad adcon...@ubuntu.com Wed, 03 Oct 2012 15:58:02 -0600 ** Changed in: eglibc (Ubuntu Quantal) Status: Fix Committed = Fix Released ** CVE added: http://www.cve.mitre.org/cgi- bin/cvename.cgi?name=2012-3406 ** CVE added: http://www.cve.mitre.org/cgi- bin/cvename.cgi?name=2012-3480 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
** Changed in: eglibc (Ubuntu Precise) Assignee: Chris J Arges (christopherarges) = Adam Conrad (adconrad) ** Changed in: eglibc (Ubuntu Quantal) Assignee: Chris J Arges (christopherarges) = Adam Conrad (adconrad) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
** Branch linked: lp:ubuntu/eglibc -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
** Changed in: eglibc (Ubuntu Quantal) Status: In Progress = Fix Committed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
The change looks sane but please fill in the required SRU data (I've pasted the fields in the description for you) so we can get this done for precise. ** Description changed: + [Impact] + + [Fix] + + [Test Case] + + [Regression Potential] + + [Original Report] See http://sourceware.org/bugzilla/show_bug.cgi?id=14048. ** Changed in: eglibc (Ubuntu Precise) Status: In Progress = Incomplete -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
Ok changes made. Thanks ** Description changed: [Impact] + When using fmod, some inputs will cause incorrect results. [Fix] + An upstream eglibc patch (c5bfe3d5ba29d36563f1e4bd4f8d7336093ee6fc) fixes this particular issue. [Test Case] + See comment https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1000498/comments/1 for a C program that exhibits this issue. [Regression Potential] + This adds the fixes for fmod and adds the appropriate test cases in eglibc. [Original Report] See http://sourceware.org/bugzilla/show_bug.cgi?id=14048. ** Changed in: eglibc (Ubuntu Precise) Status: Incomplete = In Progress -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
Here is a fix for Precise in my PPA as well. https://launchpad.net/~christopherarges/+archive/ppa-test/+sourcepub/2623069/+listing-archive-extra ** Changed in: eglibc (Ubuntu Precise) Status: Confirmed = In Progress -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
** Patch added: eglibc-precise-fix-lp1000498.debdiff https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1000498/+attachment/3279619/+files/eglibc-precise-fix-lp1000498.debdiff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
** Patch added: eglibc-quantal-fix-lp1000498.debdiff https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1000498/+attachment/3279620/+files/eglibc-quantal-fix-lp1000498.debdiff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
Attached is a patch for quantal. I have built a fix for testing in my PPA here: https://launchpad.net/~christopherarges/+archive/ppa-test/+sourcepub/2614914/+listing-archive-extra I've been able to run the testcase in #1 and before it results in NaN, and after the patch I see 0. ** Changed in: eglibc (Ubuntu Quantal) Status: Confirmed = In Progress ** Patch added: fix_lp1000498_quantal.debdiff https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1000498/+attachment/3269900/+files/fix_lp1000498_quantal.debdiff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
The attachment fix_lp1000498_quantal.debdiff of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu- sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu- sponsors team please also unsubscribe the team from this bug report. [This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.] ** Tags added: patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
** Also affects: eglibc (Ubuntu Precise) Importance: Undecided Status: New ** Also affects: eglibc (Ubuntu Quantal) Importance: Medium Assignee: Chris J Arges (christopherarges) Status: Confirmed ** Changed in: eglibc (Ubuntu Precise) Status: New = Confirmed ** Changed in: eglibc (Ubuntu Precise) Importance: Undecided = Medium ** Changed in: eglibc (Ubuntu Precise) Assignee: (unassigned) = Chris J Arges (christopherarges) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
** Changed in: eglibc (Ubuntu) Assignee: (unassigned) = Chris J Arges (christopherarges) ** Changed in: eglibc (Ubuntu) Importance: Undecided = Medium -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
** Bug watch added: Sourceware.org Bugzilla #14048 http://sourceware.org/bugzilla/show_bug.cgi?id=14048 ** Also affects: eglibc via http://sourceware.org/bugzilla/show_bug.cgi?id=14048 Importance: Unknown Status: Unknown -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
Launchpad has imported 13 comments from the remote bug at http://sourceware.org/bugzilla/show_bug.cgi?id=14048. If you reply to an imported comment from within Launchpad, your comment will be sent to the remote bug automatically. Read more about Launchpad's inter-bugtracker facilities at https://help.launchpad.net/InterBugTracking. On 2012-05-02T09:09:35+00:00 Jkummerow wrote: I've come across a case where fmod() does not return the expected result. Reduced repro: -- #include math.h #include stdio.h #include iostream int main() { double x = 2.225073858507201e-308; double y = 5e-324; double z = fmod(x, y); // printf(result: %g\n, z); // see [1] below. std::cout result: z std::endl; return 0; } -- Expected result: 0 Actual result: -nan I can repro the bug on both a Gentoo (gcc-4.5.3, kernel 3.3.4) and an Ubuntu Precise (gcc-4.6.3, kernel 3.2.5) system, which both have glibc-2.15, and both are x86_64. It works correctly on Ubuntu Lucid (glibc-2.11, gcc-4.4.2, kernel 2.6.38.8). Further, it works correctly when compiling with either of -O1, -O2, -O3. It also works correctly when removing the std::cout ... and #include iostream lines, and using the printf(... line (marked [1]) instead. I've looked at the generated machine code. In the buggy case, glibc's fmod is called directly: main(): 400744: 55 push rbp 400745: 48 89 e5movrbp,rsp 400748: 48 83 ec 20 subrsp,0x20 40074c: 48 b8 ff ff ff ff ffmovabs rax,0xf 400753: ff 0f 00 400756: 48 89 45 f8 movQWORD PTR [rbp-0x8],rax 40075a: b8 01 00 00 00 moveax,0x1 40075f: 48 89 45 f0 movQWORD PTR [rbp-0x10],rax 400763: f2 0f 10 4d f0 movsd xmm1,QWORD PTR [rbp-0x10] 400768: f2 0f 10 45 f8 movsd xmm0,QWORD PTR [rbp-0x8] 40076d: e8 de fe ff ff call 400650 fmod@plt 400772: f2 0f 11 45 e8 movsd QWORD PTR [rbp-0x18],xmm0 400777: f2 0f 10 45 e8 movsd xmm0,QWORD PTR [rbp-0x18] 40077c: bf dc 08 40 00 movedi,0x4008dc 400781: b8 01 00 00 00 moveax,0x1 400786: e8 75 fe ff ff call 400600 printf@plt 40078b: b8 00 00 00 00 moveax,0x0 400790: c9 leave 400791: c3 ret When I do any of the changes that make it work (e.g. remove the iostream include), g++ decides to inline an FPU-based implementation of fmod (which seems to work as expected) and only calls out to glibc as a fallback: main(): 400604: 55 push rbp 400605: 48 89 e5movrbp,rsp 400608: 48 83 ec 40 subrsp,0x40 40060c: 48 b8 ff ff ff ff ffmovabs rax,0xf 400613: ff 0f 00 400616: 48 89 45 f8 movQWORD PTR [rbp-0x8],rax 40061a: b8 01 00 00 00 moveax,0x1 40061f: 48 89 45 f0 movQWORD PTR [rbp-0x10],rax 400623: dd 45 f8fldQWORD PTR [rbp-0x8] 400626: dd 45 f0fldQWORD PTR [rbp-0x10] 400629: d9 c0 fldst(0) 40062b: d9 c2 fldst(2) 40062d: d9 f8 fprem 40062f: df e0 fnstsw ax 400631: f6 c4 04test ah,0x4 400634: 75 f7 jne40062d main+0x29 400636: dd d9 fstp st(1) 400638: dd 5d d8fstp QWORD PTR [rbp-0x28] 40063b: f2 0f 10 45 d8 movsd xmm0,QWORD PTR [rbp-0x28] 400640: 66 0f 2e c0 ucomisd xmm0,xmm0 400644: 7a 06 jp 40064c main+0x48 400646: 66 0f 2e c0 ucomisd xmm0,xmm0 40064a: 74 17 je 400663 main+0x5f 40064c: dd 5d c8fstp QWORD PTR [rbp-0x38] 40064f: f2 0f 10 4d c8 movsd xmm1,QWORD PTR [rbp-0x38] 400654: dd 5d c8fstp QWORD PTR [rbp-0x38] 400657: f2 0f 10 45 c8 movsd xmm0,QWORD PTR [rbp-0x38] 40065c: e8 af fe ff ff call 400510 fmod@plt 400661: eb 04 jmp400667 main+0x63 400663: dd d8 fstp st(0) 400665: dd d8 fstp st(0) 400667: f2 0f 11 45 e8 movsd QWORD PTR [rbp-0x18],xmm0 40066c: f2 0f 10 45 e8 movsd xmm0,QWORD PTR [rbp-0x18] 400671: bf 7c 07 40 00 movedi,0x40077c 400676: b8 01 00 00 00 moveax,0x1 40067b: e8 70 fe ff ff call 4004f0 printf@plt 400680: b8 00 00 00 00
[Bug 1000498] Re: fmod() incorrectly returns NaN for (some?) denormalized inputs
Status changed to 'Confirmed' because the bug affects multiple users. ** Changed in: eglibc (Ubuntu) Status: New = Confirmed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1000498 Title: fmod() incorrectly returns NaN for (some?) denormalized inputs To manage notifications about this bug go to: https://bugs.launchpad.net/eglibc/+bug/1000498/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs