From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3FA87389EC5B; Fri, 7 Oct 2022 13:49:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FA87389EC5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665150566; bh=h8ZpZWyfys44HAiE7MYyelvnfMbPi7j9EiqjiyxUFiA=; h=From:To:Subject:Date:From; b=NemA6GvWgXqRV2MkaW1skvs08awGF2aQ5rAzAmmPvS0wjLt5MMjuc4H69zDVKFyad fgod6y0EIAlGYy7oRLL/kXPL7xp7f1Xqd7HWRJkfKH+xdW3+Lir/z0Veis12eu7Mnm Pt6EJUgD6XlUTVcX81KJHmdt7pX+8PGh++d00Ejc= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/107180] New: Itanium ABI says to block in the emergency EH buffer if memory cannot be acquired Date: Fri, 07 Oct 2022 13:49:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D107180 Bug ID: 107180 Summary: Itanium ABI says to block in the emergency EH buffer if memory cannot be acquired Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html#imp-emergency says: "Additional threads are blocked until one of the 16 de-allocates its emerge= ncy buffer storage." Ignoring the fact that we don't limit the number of threads that can use the buffer concurrently, our __cxa_allocate_exception first tries malloc, then tries the emergency pool, then terminates. We should add a condition_variab= le to the pool and block when it's full. This needs to be optional though. For some users blocking indefinitely is w= orse than terminating. Maybe use a tunable.=