Bug 15490 - nearbyint scheduling for spurious exceptions
Summary: nearbyint scheduling for spurious exceptions
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: 2.17
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-19 18:10 UTC by Joseph Myers
Modified: 2014-06-13 17:44 UTC (History)
0 users

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 Joseph Myers 2013-05-19 18:10:18 UTC
Code in the C nearbyintf and possibly other nearbyint implementations can be scheduled by the compiler so arithmetic that raises the "inexact" exception runs after the fesetenv intended to clear that exception.

http://sourceware.org/ml/libc-alpha/2013-05/msg00720.html

gives an example I can reproduce on x86_64 with --disable-multi-arch (otherwise the SSE4.1 version gets used).
Comment 1 Joseph Myers 2013-05-19 18:41:21 UTC
Fixed for 2.18 by:

commit 3e694268750d51acc6a68b0ee7ded25a52902c20
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sun May 19 18:40:25 2013 +0000

    Fix nearbyint scheduling of arithmetic past fesetenv (bug 15490).