if (terminate_asap)
::_Exit(0);
}
-void AppSide::handle_initial_addresses() const
+void AppSide::handle_initial_addresses()
{
+ this->need_memory_info_ = true;
s_mc_message_initial_addresses_reply_t answer = {};
answer.type = MessageType::INITIAL_ADDRESSES_REPLY;
answer.mmalloc_default_mdp = mmalloc_get_current_heap();
xbt_assert(received_size == sizeof(_type_), "Unexpected size for " _name_ " (%zd != %zu)", received_size, \
sizeof(_type_))
-void AppSide::handle_messages() const
+void AppSide::handle_messages()
{
while (true) { // Until we get a CONTINUE message
XBT_DEBUG("Waiting messages from model-checker");
std::array<char, MC_MESSAGE_LENGTH> message_buffer;
ssize_t received_size = channel_.receive(message_buffer.data(), message_buffer.size());
+ if (received_size == 0) {
+ XBT_DEBUG("Socket closed on the Checker side, bailing out.");
+ ::_Exit(0); // Nobody's listening to that process anymore => exit as quickly as possible.
+ }
xbt_assert(received_size >= 0, "Could not receive commands from the model-checker");
xbt_assert(static_cast<size_t>(received_size) >= sizeof(s_mc_message_t), "Cannot handle short message (size=%zd)",
received_size);
}
}
-void AppSide::main_loop() const
+void AppSide::main_loop()
{
simgrid::mc::processes_time.resize(simgrid::kernel::actor::ActorImpl::get_maxpid());
MC_ignore_heap(simgrid::mc::processes_time.data(),
}
}
-void AppSide::report_assertion_failure() const
+void AppSide::report_assertion_failure()
{
xbt_assert(channel_.send(MessageType::ASSERTION_FAILED) == 0, "Could not send assertion to model-checker");
this->handle_messages();
void AppSide::declare_symbol(const char* name, int* value) const
{
- if (not MC_is_active() || not need_memory_info_)
+ if (not MC_is_active() || not need_memory_info_) {
+ XBT_CRITICAL("Ignore AppSide::declare_symbol(%s)", name);
return;
+ }
s_mc_message_register_symbol_t message = {};
message.type = MessageType::REGISTER_SYMBOL;