socket_event_ = event_new(
base, get_channel().get_socket(), EV_READ | EV_PERSIST,
- [](evutil_socket_t sig, short events, void* arg) {
+ [](evutil_socket_t, short events, void* arg) {
auto checker = static_cast<simgrid::mc::CheckerSide*>(arg);
if (events == EV_READ) {
std::array<char, MC_MESSAGE_LENGTH> buffer;
if (running()) {
XBT_DEBUG("Killing process");
- finalize(true);
kill(get_pid(), SIGKILL);
- terminate();
- handle_waitpid();
+ while (waitpid(-1, nullptr, WNOHANG) > 0) {
+ /* we don't really care about errors here, as we are shutting things down anyway */
+ /* The child will get ripped by the next waitpid anyway */
+ }
}
+ // usleep(500); // Try to reduce the load on my system. Commented because it's not even enough :(
}
void CheckerSide::finalize(bool terminate_asap)
s_mc_message_ignore_memory_t message;
xbt_assert(size == sizeof(message), "Broken message");
memcpy(&message, buffer, sizeof(message));
- get_remote_memory()->unignore_heap((void*)(std::uintptr_t)message.addr, message.size);
+ get_remote_memory()->unignore_heap((void*)message.addr, message.size);
} else {
XBT_INFO("Ignoring an UNIGNORE_HEAP message because we don't need to introspect memory.");
}
xbt_assert(not this->running(), "Inconsistent state");
break;
} else {
- XBT_ERROR("Could not wait for pid");
- throw simgrid::xbt::errno_error();
+ xbt_die("Could not wait for pid: %s", strerror(errno));
}
}