#include "src/mc/mc_config.hpp"
#include "src/mc/mc_exit.hpp"
#include "src/mc/mc_private.hpp"
+
+#if SIMGRID_HAVE_STATEFUL_MC
#include "src/mc/sosp/RemoteProcessMemory.hpp"
+#endif
#include <sys/wait.h>
}
}
-void Exploration::report_crash(int status)
+XBT_ATTRIB_NORETURN void Exploration::report_crash(int status)
{
XBT_INFO("**************************");
XBT_INFO("** CRASH IN THE PROGRAM **");
XBT_INFO("**************************");
- if (WIFSIGNALED(status))
- XBT_INFO("From signal: %s", strsignal(WTERMSIG(status)));
+ if (WIFSIGNALED(status)) // FreeBSD use "Abort trap" as a strsignal for SIGABRT that is part of our tests
+ XBT_INFO("From signal: %s", WTERMSIG(status) == SIGABRT ? "Aborted" : strsignal(WTERMSIG(status)));
else if (WIFEXITED(status))
XBT_INFO("From exit: %i", WEXITSTATUS(status));
if (not xbt_log_no_loc)
if (xbt_log_no_loc) {
XBT_INFO("Stack trace not displayed because you passed --log=no_loc");
} else {
- auto* memory = get_remote_app().get_remote_process_memory();
+#if SIMGRID_HAVE_STATEFUL_MC
+ const auto* memory = get_remote_app().get_remote_process_memory();
if (memory) {
XBT_INFO("Stack trace:");
memory->dump_stack();
- } else {
+ } else
+#endif
XBT_INFO("Stack trace not shown because there is no memory introspection.");
- }
}
system_exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
}
-void Exploration::report_assertion_failure()
+XBT_ATTRIB_NORETURN void Exploration::report_assertion_failure()
{
XBT_INFO("**************************");
XBT_INFO("*** PROPERTY NOT VALID ***");
system_exit(SIMGRID_MC_EXIT_SAFETY);
}
-void Exploration::system_exit(int status)
+void Exploration::system_exit(int status) const
{
::exit(status);
}