https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64535
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- Is the following required to work? #include <exception> #include <new> #include <sys/resource.h> struct large { char s[1024*1024*1024]; }; int main() { rlimit lim; lim.rlim_cur = 1024*1024*1024; lim.rlim_max = 1024*1024*1024; setrlimit (RLIMIT_AS, &lim); try { throw large (); } catch (large&) { } catch (std::bad_alloc) { } } I get > ./a.out terminate called without an active exception Aborted