https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107180
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 emergency 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_variable to the pool and block when it's full. This needs to be optional though. For some users blocking indefinitely is worse than terminating. Maybe use a tunable.