https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106568
--- Comment #5 from Jeffrey Walton <noloader at gmail dot com> --- (In reply to Andrew Pinski from comment #3) > Though there might be an EH issue but there has not been an EH issue for a > long time . This is an interesting observation. The stack trace shows frame #0 is in pthread_kill_thread (or similar). But up in our program, around frame #4 or #5, gdb is identifying the line with a catch (CryptoPP::Exception& ). CryptoPP::Exception is the library's base class exception, so it should catch everything the library throws. This is the line gdb faults (https://github.com/weidai11/cryptopp/blob/master/test.cpp#L442) : catch(const Exception &e) // 442 { std::cout << "\nException caught: " << e.what() << std::endl; return -1; } which makes no sense to me. And the program does not take the exception path. Instead it segfaults.