From: Arnaud Giersch Date: Tue, 27 Apr 2021 17:00:25 +0000 (+0200) Subject: We don't want to survive a ForcefulKillException! X-Git-Tag: v3.28~401 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/aa30bf6e0f4908e00e77ad0e132aca707df9fa9c We don't want to survive a ForcefulKillException! --- diff --git a/src/xbt/exception.cpp b/src/xbt/exception.cpp index 4ded329ea1..8b9c3d3219 100644 --- a/src/xbt/exception.cpp +++ b/src/xbt/exception.cpp @@ -104,28 +104,24 @@ static void handler() // We manage C++ exception ourselves catch (const std::exception& e) { log_exception(xbt_log_priority_critical, "Uncaught exception", e); - show_backtrace(bt); - std::abort(); } catch (const simgrid::ForcefulKillException&) { XBT_ERROR("Received a ForcefulKillException at the top-level exception handler. Maybe a Java->C++ call that is not " "protected in a try/catch?"); - show_backtrace(bt); } // We don't know how to manage other exceptions catch (...) { // If there was another handler let's delegate to it - if (previous_terminate_handler) + if (previous_terminate_handler) { previous_terminate_handler(); - else { - XBT_ERROR("Unknown uncaught exception"); - show_backtrace(bt); - std::abort(); + XBT_ERROR("Unexpected return from delegated terminate handler"); } + XBT_ERROR("Unknown uncaught exception"); } - XBT_INFO("BAM"); + show_backtrace(bt); + std::abort(); } void install_exception_handler()