From aa30bf6e0f4908e00e77ad0e132aca707df9fa9c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 27 Apr 2021 19:00:25 +0200 Subject: [PATCH] We don't want to survive a ForcefulKillException! --- src/xbt/exception.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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() -- 2.20.1