X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/497aee08bf8b36b4981083b79d8473991db1ccde..e88fcca408491a220b09ee34cad8afa872b0ceaa:/src/mc/api/RemoteApp.cpp diff --git a/src/mc/api/RemoteApp.cpp b/src/mc/api/RemoteApp.cpp index 87ac817688..64aed11e6e 100644 --- a/src/mc/api/RemoteApp.cpp +++ b/src/mc/api/RemoteApp.cpp @@ -7,6 +7,7 @@ #include "src/internal_config.h" // HAVE_SMPI #include "src/mc/explo/Exploration.hpp" #include "src/mc/mc_config.hpp" +#include "xbt/asserts.h" #if HAVE_SMPI #include "smpi/smpi.h" #include "src/smpi/include/private.hpp" @@ -87,7 +88,14 @@ static void run_child_process(int socket, const std::vector& args) "Unable to find a binary to exec on the command line. Did you only pass config flags?"); execvp(args[i], args.data() + i); - xbt_die("The model-checked process failed to exec(%s): %s", args[i], strerror(errno)); + XBT_CRITICAL("The model-checked process failed to exec(%s): %s.\n" + " Make sure that your binary exists on disk and is executable.", + args[i], strerror(errno)); + if (strchr(args[i], '=') != nullptr) + XBT_CRITICAL("If you want to pass environment variables to the application, please use --cfg=model-check/setenv:%s", + args[i]); + + xbt_die("Aborting now."); } RemoteApp::RemoteApp(const std::vector& args) @@ -165,13 +173,16 @@ void RemoteApp::get_actors_status(std::map& whereto) const to_c_str(answer.type), (int)answer.type, (int)received, (int)MessageType::ACTORS_STATUS_REPLY, (int)sizeof(answer)); - s_mc_message_actors_status_one_t status[answer.count]; - received = model_checker_->channel().receive(&status, sizeof(status)); - xbt_assert(static_cast(received) == sizeof(status)); + std::vector status(answer.count); + if (answer.count > 0) { + size_t size = status.size() * sizeof(s_mc_message_actors_status_one_t); + received = model_checker_->channel().receive(status.data(), size); + xbt_assert(static_cast(received) == size); + } whereto.clear(); for (auto const& actor : status) - whereto.try_emplace(actor.aid, ActorState(actor.aid, actor.enabled, actor.max_considered)); + whereto.try_emplace(actor.aid, actor.aid, actor.enabled, actor.max_considered); } void RemoteApp::check_deadlock() const @@ -187,13 +198,12 @@ void RemoteApp::check_deadlock() const (int)sizeof(message)); if (message.value != 0) { - XBT_CINFO(mc_global, "**************************"); - XBT_CINFO(mc_global, "*** DEADLOCK DETECTED ***"); - XBT_CINFO(mc_global, "**************************"); XBT_CINFO(mc_global, "Counter-example execution trace:"); for (auto const& frame : model_checker_->get_exploration()->get_textual_trace()) XBT_CINFO(mc_global, " %s", frame.c_str()); - XBT_CINFO(mc_global, "Path = %s", model_checker_->get_exploration()->get_record_trace().to_string().c_str()); + XBT_INFO("You can debug the problem (and see the whole details) by rerunning out of simgrid-mc with " + "--cfg=model-check/replay:'%s'", + model_checker_->get_exploration()->get_record_trace().to_string().c_str()); model_checker_->get_exploration()->log_state(); throw DeadlockError(); }