static std::terminate_handler previous_terminate_handler = nullptr;
-static void handler()
+XBT_ATTRIB_NORETURN static void handler()
{
// Avoid doing crazy things if we get an uncaught exception inside an uncaught exception
static std::atomic_flag lock = ATOMIC_FLAG_INIT;
std::abort();
}
- // Get the current backtrace and exception
- simgrid::xbt::Backtrace bt = simgrid::xbt::Backtrace();
+ // Get the current exception and show backtrace
try {
std::rethrow_exception(std::current_exception());
}
}
XBT_ERROR("Unknown uncaught exception");
}
- show_backtrace(bt);
+ show_backtrace(simgrid::xbt::Backtrace());
std::abort();
}