In some cases, we terminate the model-checker brutally inside of its
event loop instead of letting the event loop and the model checker
terminate cleanly. In this case, the model-checked process could still
be left alive.
Because the model-checker was still around, tesh was still waiting on
the pipe and ended-up timing out.
We now SIGKILL the model-checked process when exiting the
model-checker brutally.
case MC_MESSAGE_ASSERTION_FAILED:
MC_report_assertion_error();
case MC_MESSAGE_ASSERTION_FAILED:
MC_report_assertion_error();
- ::exit(SIMGRID_MC_EXIT_SAFETY);
+ this->exit(SIMGRID_MC_EXIT_SAFETY);
+/** 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];
bool ModelChecker::handle_events()
{
char buffer[MC_MESSAGE_LENGTH];
xbt_die("Could not get exit status");
if (WIFSIGNALED(status)) {
MC_report_crash(status);
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);
{
mc_model_checker->wait_client(mc_model_checker->process());
}
{
mc_model_checker->wait_client(mc_model_checker->process());
}
private:
void setup_ignore();
bool handle_message(char* buffer, ssize_t size);
private:
void setup_ignore();
bool handle_message(char* buffer, ssize_t size);
xbt_free(initial_global_state->send_diff);
initial_global_state->send_diff = NULL;
MC_print_statistics(mc_stats);
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 *****");
}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);
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);