From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6276D3858D1E; Thu, 22 Dec 2022 23:35:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6276D3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671752106; bh=qnBq0dViecY9FqJXqhj5hPdTWBAQQVMmAilFrTCB17s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=igIcOG6YyZsIVzlK6rhFN14bpyC6WUGd/tcHV9iHGRvmym5ZHTcYDgv0X0w+B6HAU hgOGufgfe0tUBwd9Cfqbht6kp3RUr92zTUOjCI7vkkdzJoOtEJPBRvxmzOck3ioqI1 tqQ3mjX0ftykf6nlPj518q0sw7c6DXMCkHocpFdA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/105730] [12/13 Regression] Issue with commit - Allow std::condition_variable waits to be cancelled Date: Thu, 22 Dec 2022 23:35:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105730 --- Comment #11 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:ee4af2ed0b7322884ec4ff537564683c3749b813 commit r13-4857-gee4af2ed0b7322884ec4ff537564683c3749b813 Author: Jonathan Wakely 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&)@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.=