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");
}
}
-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;
public:
AppSide();
explicit AppSide(int fd) : channel_(fd) {}
- void handle_messages() const;
+ void handle_messages();
private:
void handle_deadlock_check(const s_mc_message_t* msg) const;
void handle_simcall_execute(const s_mc_message_simcall_execute_t* message) const;
void handle_finalize(const s_mc_message_int_t* msg) const;
- void handle_initial_addresses() const;
+ void handle_initial_addresses();
void handle_actors_status() const;
void handle_actors_maxpid() const;
public:
Channel const& get_channel() const { return channel_; }
Channel& get_channel() { return channel_; }
- XBT_ATTRIB_NORETURN void main_loop() const;
- void report_assertion_failure() const;
+ XBT_ATTRIB_NORETURN void main_loop();
+ void report_assertion_failure();
void ignore_memory(void* addr, std::size_t size) const;
void ignore_heap(void* addr, std::size_t size) const;
void unignore_heap(void* addr, std::size_t size) const;
setup_events();
wait_application_process(pid_);
- wait_for_requests();
-
// Request the initial memory on need
if (need_memory_introspection) {
channel_.send(MessageType::INITIAL_ADDRESSES);
/* We now have enough info to create the memory address space */
remote_memory_ = std::make_unique<simgrid::mc::RemoteProcessMemory>(pid_, answer.mmalloc_default_mdp);
}
+
+ wait_for_requests();
}
CheckerSide::~CheckerSide()