https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106568
--- Comment #7 from Jeffrey Walton <noloader at gmail dot com> --- (In reply to Andrew Pinski from comment #6) > >And the program does not take the exception path. Instead it segfaults. > > If I read the backtrace correctly, it is trying to resume an unwind because > it didn't find a catch that would hit in main but the following code hits > the assert while unwinding: > /* Choose between continuing to process _Unwind_RaiseException > or _Unwind_ForcedUnwind. */ > if (exc->private_1 == 0) > code = _Unwind_RaiseException_Phase2 (exc, &cur_context, &frames); > else > code = _Unwind_ForcedUnwind_Phase2 (exc, &cur_context, &frames); > > gcc_assert (code == _URC_INSTALL_CONTEXT); > > And then abort calls raise which then segfaults. Thanks again Andrew. We have exception handlers for both CryptoPP::Exception& and std::exception& starting for main() around https://github.com/weidai11/cryptopp/blob/master/test.cpp#L442 . However, we should not hit either of them. When they trigger there's a problem that needs to be fixed. The code in question tests for good and bad digital signatures. It should catch a SignatureVerificationFailed exception on occasion and this is expected. But it should catch closer to the the actual test (and not in main or Test::scoped_main). Not to mention 'catch throw' is not catching anything under gdb. Is there something we should be doing differently?