From: Martin Quinson Date: Tue, 2 Aug 2022 14:58:56 +0000 (+0200) Subject: Sanitize MC finalization process and inline a function X-Git-Tag: v3.32~97 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ad55653c7ce92d24ea3c5e3caa7828db31653226?hp=261e680f278e36ba4efbc0755fb08d00ff3cad83 Sanitize MC finalization process and inline a function --- diff --git a/src/mc/api.cpp b/src/mc/api.cpp index 80101e4006..9e3f27f44f 100644 --- a/src/mc/api.cpp +++ b/src/mc/api.cpp @@ -109,7 +109,6 @@ simgrid::mc::Snapshot* Api::take_snapshot(long num_state) const void Api::s_close() { - remote_app_.reset(); if (simgrid::mc::property_automaton != nullptr) { xbt_automaton_free(simgrid::mc::property_automaton); simgrid::mc::property_automaton = nullptr; diff --git a/src/mc/api/RemoteApp.cpp b/src/mc/api/RemoteApp.cpp index 5edd18ca02..d4c8961ea0 100644 --- a/src/mc/api/RemoteApp.cpp +++ b/src/mc/api/RemoteApp.cpp @@ -97,7 +97,12 @@ RemoteApp::RemoteApp(const std::function& code) RemoteApp::~RemoteApp() { - this->close(); + initial_snapshot_ = nullptr; + if (model_checker_) { + model_checker_->shutdown(); + model_checker_ = nullptr; + mc_model_checker = nullptr; + } } void RemoteApp::restore_initial_state() const @@ -120,16 +125,6 @@ void RemoteApp::log_state() const } } -void RemoteApp::close() -{ - initial_snapshot_ = nullptr; - if (model_checker_) { - model_checker_->shutdown(); - model_checker_ = nullptr; - mc_model_checker = nullptr; - } -} - unsigned long RemoteApp::get_maxpid() const { return model_checker_->get_remote_process().get_maxpid(); diff --git a/src/mc/api/RemoteApp.hpp b/src/mc/api/RemoteApp.hpp index 377b99ff96..e88c168089 100644 --- a/src/mc/api/RemoteApp.hpp +++ b/src/mc/api/RemoteApp.hpp @@ -43,7 +43,6 @@ public: explicit RemoteApp(const std::function& code); ~RemoteApp(); - void close(); void restore_initial_state() const; diff --git a/src/mc/explo/simgrid_mc.cpp b/src/mc/explo/simgrid_mc.cpp index 769c14c81f..df448575f2 100644 --- a/src/mc/explo/simgrid_mc.cpp +++ b/src/mc/explo/simgrid_mc.cpp @@ -81,6 +81,5 @@ int main(int argc, char** argv) res = SIMGRID_MC_EXIT_LIVENESS; } simgrid::mc::Api::get().s_close(); - checker.release(); // FIXME: this line should not exist, but it segfaults in liveness return res; }