This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/68921] [5/6 Regression] std::future::wait() makes invalid futex calls and spins
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Dec 2015 18:29:32 +0000
- Subject: [Bug libstdc++/68921] [5/6 Regression] std::future::wait() makes invalid futex calls and spins
- Auto-submitted: auto-generated
- References: <bug-68921-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68921
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This fixes it:
--- a/libstdc++-v3/src/c++11/futex.cc
+++ b/libstdc++-v3/src/c++11/futex.cc
@@ -52,7 +52,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// we will fall back to spin-waiting. The only thing we could do
// here on errors is abort.
int ret __attribute__((unused));
- ret = syscall (SYS_futex, __addr, futex_wait_op, __val);
+ ret = syscall (SYS_futex, __addr, futex_wait_op, __val, nullptr);
_GLIBCXX_DEBUG_ASSERT(ret == 0 || errno == EINTR || errno == EAGAIN);
return true;
}