public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/105730] [12 Regression] Issue with commit - Allow std::condition_variable waits to be cancelled
Date: Wed, 18 Jan 2023 15:14:56 +0000	[thread overview]
Message-ID: <bug-105730-4-DZBaTppgsL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105730-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105730

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:937b0f05910bd814459ba9af0972041514274cd7

commit r12-9051-g937b0f05910bd814459ba9af0972041514274cd7
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Dec 22 09:56:47 2022 +0000

    libstdc++: Avoid recursion in __nothrow_wait_cv::wait [PR105730]

    The commit r12-5877-g9e18a25331fa25 removed the incorrect
    noexcept-specifier from std::condition_variable::wait and gave the new
    symbol version @@GLIBCXX_3.4.30. It also redefined the original symbol
    std::condition_variable::wait(unique_lock<mutex>&)@GLIBCXX_3.4.11 as an
    alias for a new symbol, __gnu_cxx::__nothrow_wait_cv::wait, which still
    has the incorrect noexcept guarantee. That __nothrow_wait_cv::wait is
    just a wrapper around the real condition_variable::wait which adds
    noexcept and so terminates on a __forced_unwind exception.

    This doesn't work on uclibc, possibly due to a dynamic linker bug. When
    __nothrow_wait_cv::wait calls the condition_variable::wait function it
    binds to the alias symbol, which means it just calls itself recursively
    until the stack overflows.

    This change avoids the possibility of a recursive call by changing the
    __nothrow_wait_cv::wait function so that instead of calling
    condition_variable::wait it re-implements it. This requires accessing
    the private _M_cond member of condition_variable, so we need to use the
    trick of instantiating a template with the member-pointer of the private
    member.

    libstdc++-v3/ChangeLog:

            PR libstdc++/105730
            * src/c++11/compatibility-condvar.cc (__nothrow_wait_cv::wait):
            Access private data member of base class and call its wait
            member.

    (cherry picked from commit ee4af2ed0b7322884ec4ff537564683c3749b813)

  parent reply	other threads:[~2023-01-18 15:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25 17:32 [Bug libstdc++/105730] New: " lancethepants at gmail dot com
2022-05-26  9:18 ` [Bug libstdc++/105730] " marxin at gcc dot gnu.org
2022-05-26  9:18 ` marxin at gcc dot gnu.org
2022-10-25  7:17 ` [Bug libstdc++/105730] [12/13 Regression] " pinskia at gcc dot gnu.org
2022-10-25 11:57 ` redi at gcc dot gnu.org
2022-10-25 12:01 ` redi at gcc dot gnu.org
2022-12-20 13:48 ` rguenth at gcc dot gnu.org
2022-12-20 15:50 ` pinskia at gcc dot gnu.org
2022-12-21 11:52 ` redi at gcc dot gnu.org
2022-12-21 12:10 ` redi at gcc dot gnu.org
2022-12-21 12:24 ` glex.spb at gmail dot com
2022-12-21 13:22 ` redi at gcc dot gnu.org
2022-12-21 13:22 ` redi at gcc dot gnu.org
2022-12-21 13:45 ` glex.spb at gmail dot com
2022-12-22 23:35 ` cvs-commit at gcc dot gnu.org
2023-01-17 18:25 ` [Bug libstdc++/105730] [12 " lancethepants at gmail dot com
2023-01-17 19:01 ` redi at gcc dot gnu.org
2023-01-17 19:23 ` glex.spb at gmail dot com
2023-01-18 15:14 ` cvs-commit at gcc dot gnu.org [this message]
2023-01-18 15:15 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-105730-4-DZBaTppgsL@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).