This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/68921] [5/6 Regression] std::future::wait() makes invalid futex calls and spins


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;
       }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]