case MC_MESSAGE_ASSERTION_FAILED:
MC_report_assertion_error();
- ::exit(SIMGRID_MC_EXIT_SAFETY);
+ this->exit(SIMGRID_MC_EXIT_SAFETY);
break;
default:
return true;
}
+/** Terminate the model-checker aplication */
+void ModelChecker::exit(int status)
+{
+ // TODO, terminate the model checker politely instead of exiting rudel
+ if (process().running())
+ kill(process().pid(), SIGKILL);
+ ::exit(status);
+}
+
bool ModelChecker::handle_events()
{
char buffer[MC_MESSAGE_LENGTH];
xbt_die("Could not get exit status");
if (WIFSIGNALED(status)) {
MC_report_crash(status);
- ::exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
+ mc_model_checker->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
}
}
xbt_free(initial_global_state->send_diff);
initial_global_state->send_diff = NULL;
MC_print_statistics(mc_stats);
- exit(SIMGRID_MC_EXIT_NON_DETERMINISM);
+ mc_model_checker->exit(SIMGRID_MC_EXIT_NON_DETERMINISM);
}else if(_sg_mc_comms_determinism && (!initial_global_state->send_deterministic && !initial_global_state->recv_deterministic)) {
XBT_INFO("****************************************************");
XBT_INFO("***** Non-deterministic communications pattern *****");
xbt_free(initial_global_state->recv_diff);
initial_global_state->recv_diff = NULL;
MC_print_statistics(mc_stats);
- exit(SIMGRID_MC_EXIT_NON_DETERMINISM);
+ mc_model_checker->exit(SIMGRID_MC_EXIT_NON_DETERMINISM);
}
}
}