Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move another function out of ModelChecker
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 12 Mar 2023 22:59:42 +0000 (23:59 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 12 Mar 2023 22:59:42 +0000 (23:59 +0100)
examples/cpp/mc-bugged2/s4u-mc-bugged2.tesh
examples/cpp/mc-failing-assert/s4u-mc-failing-assert-nodpor.tesh
src/mc/ModelChecker.cpp
src/mc/explo/Exploration.cpp
src/mc/explo/Exploration.hpp

index d64aed9..a104fb8 100644 (file)
@@ -4,16 +4,16 @@
 ! timeout 20
 $ ${bindir:=.}/../../../bin/simgrid-mc --cfg=model-check/sleep-set:true ${bindir:=.}/s4u-mc-bugged2 ${platfdir:=.}/model_checker_platform.xml  --log=root.thresh:critical --log=mc.thresh:info
 > [0.000000] [mc_dfs/INFO] Start a DFS exploration. Reduction is: dpor.
-> [0.000000] [mc_ModelChecker/INFO] **************************
-> [0.000000] [mc_ModelChecker/INFO] *** PROPERTY NOT VALID ***
-> [0.000000] [mc_ModelChecker/INFO] **************************
-> [0.000000] [mc_ModelChecker/INFO] Counter-example execution trace:
-> [0.000000] [mc_ModelChecker/INFO]   1: iRecv(mbox=0)
-> [0.000000] [mc_ModelChecker/INFO]   3: iSend(mbox=0)
-> [0.000000] [mc_ModelChecker/INFO]   1: WaitComm(from 3 to 1, mbox=0, no timeout)
-> [0.000000] [mc_ModelChecker/INFO]   1: iRecv(mbox=0)
-> [0.000000] [mc_ModelChecker/INFO]   3: WaitComm(from 3 to 1, mbox=0, no timeout)
-> [0.000000] [mc_ModelChecker/INFO]   3: iSend(mbox=0)
-> [0.000000] [mc_ModelChecker/INFO]   1: WaitComm(from 3 to 1, mbox=0, no timeout)
-> [0.000000] [mc_ModelChecker/INFO] You can debug the problem (and see the whole details) by rerunning out of simgrid-mc with --cfg=model-check/replay:'1;3;1;1;3;3;1'
+> [0.000000] [mc_explo/INFO] **************************
+> [0.000000] [mc_explo/INFO] *** PROPERTY NOT VALID ***
+> [0.000000] [mc_explo/INFO] **************************
+> [0.000000] [mc_explo/INFO] Counter-example execution trace:
+> [0.000000] [mc_explo/INFO]   1: iRecv(mbox=0)
+> [0.000000] [mc_explo/INFO]   3: iSend(mbox=0)
+> [0.000000] [mc_explo/INFO]   1: WaitComm(from 3 to 1, mbox=0, no timeout)
+> [0.000000] [mc_explo/INFO]   1: iRecv(mbox=0)
+> [0.000000] [mc_explo/INFO]   3: WaitComm(from 3 to 1, mbox=0, no timeout)
+> [0.000000] [mc_explo/INFO]   3: iSend(mbox=0)
+> [0.000000] [mc_explo/INFO]   1: WaitComm(from 3 to 1, mbox=0, no timeout)
+> [0.000000] [mc_explo/INFO] You can debug the problem (and see the whole details) by rerunning out of simgrid-mc with --cfg=model-check/replay:'1;3;1;1;3;3;1'
 > [0.000000] [mc_dfs/INFO] DFS exploration ended. 2091 unique states visited; 529 backtracks (8359 transition replays, 5739 states visited overall)
index 0cfec07..c0d8fc0 100644 (file)
@@ -5,16 +5,16 @@
 $ ${bindir:=.}/../../../bin/simgrid-mc --cfg=model-check/reduction:none -- ${bindir:=.}/s4u-mc-failing-assert ${platfdir}/small_platform.xml --log=root.thresh:critical
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'model-check/reduction' to 'none'
 > [0.000000] [mc_dfs/INFO] Start a DFS exploration. Reduction is: none.
-> [0.000000] [mc_ModelChecker/INFO] **************************
-> [0.000000] [mc_ModelChecker/INFO] *** PROPERTY NOT VALID ***
-> [0.000000] [mc_ModelChecker/INFO] **************************
-> [0.000000] [mc_ModelChecker/INFO] Counter-example execution trace:
-> [0.000000] [mc_ModelChecker/INFO]   1: iRecv(mbox=0)
-> [0.000000] [mc_ModelChecker/INFO]   3: iSend(mbox=0)
-> [0.000000] [mc_ModelChecker/INFO]   1: WaitComm(from 3 to 1, mbox=0, no timeout)
-> [0.000000] [mc_ModelChecker/INFO]   1: iRecv(mbox=0)
-> [0.000000] [mc_ModelChecker/INFO]   2: iSend(mbox=0)
-> [0.000000] [mc_ModelChecker/INFO]   1: WaitComm(from 2 to 1, mbox=0, no timeout)
-> [0.000000] [mc_ModelChecker/INFO] You can debug the problem (and see the whole details) by rerunning out of simgrid-mc with --cfg=model-check/replay:'1;3;1;1;2;1'
+> [0.000000] [mc_explo/INFO] **************************
+> [0.000000] [mc_explo/INFO] *** PROPERTY NOT VALID ***
+> [0.000000] [mc_explo/INFO] **************************
+> [0.000000] [mc_explo/INFO] Counter-example execution trace:
+> [0.000000] [mc_explo/INFO]   1: iRecv(mbox=0)
+> [0.000000] [mc_explo/INFO]   3: iSend(mbox=0)
+> [0.000000] [mc_explo/INFO]   1: WaitComm(from 3 to 1, mbox=0, no timeout)
+> [0.000000] [mc_explo/INFO]   1: iRecv(mbox=0)
+> [0.000000] [mc_explo/INFO]   2: iSend(mbox=0)
+> [0.000000] [mc_explo/INFO]   1: WaitComm(from 2 to 1, mbox=0, no timeout)
+> [0.000000] [mc_explo/INFO] You can debug the problem (and see the whole details) by rerunning out of simgrid-mc with --cfg=model-check/replay:'1;3;1;1;2;1'
 > [0.000000] [mc_dfs/INFO] DFS exploration ended. 119 unique states visited; 36 backtracks (330 transition replays, 175 states visited overall)
 
index 3f8db61..a59b3aa 100644 (file)
@@ -174,17 +174,8 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       return false;
 
     case MessageType::ASSERTION_FAILED:
-      XBT_INFO("**************************");
-      XBT_INFO("*** PROPERTY NOT VALID ***");
-      XBT_INFO("**************************");
-      XBT_INFO("Counter-example execution trace:");
-      for (auto const& s : get_exploration()->get_textual_trace())
-        XBT_INFO("  %s", s.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'",
-               get_exploration()->get_record_trace().to_string().c_str());
-      exploration_->log_state();
-      exploration_->system_exit(SIMGRID_MC_EXIT_SAFETY);
+      exploration_->report_assertion_failure();
+      break;
 
     default:
       xbt_die("Unexpected message from model-checked application");
index 3fc6127..0e44b04 100644 (file)
@@ -90,6 +90,20 @@ void Exploration::report_crash(int status)
   get_remote_app().get_remote_process_memory().terminate();
   system_exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
 }
+void Exploration::report_assertion_failure()
+{
+  XBT_INFO("**************************");
+  XBT_INFO("*** PROPERTY NOT VALID ***");
+  XBT_INFO("**************************");
+  XBT_INFO("Counter-example execution trace:");
+  for (auto const& s : get_textual_trace())
+    XBT_INFO("  %s", s.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'",
+           get_record_trace().to_string().c_str());
+  log_state();
+  system_exit(SIMGRID_MC_EXIT_SAFETY);
+}
 
 void Exploration::system_exit(int status)
 {
index 045c7c5..ee3c452 100644 (file)
@@ -45,6 +45,8 @@ public:
 
   /** Produce an error message indicating that the application crashed (status was produced by waitpid) */
   void report_crash(int status);
+  /** Produce an error message indicating that a property was violated */
+  void report_assertion_failure();
 
   /** Kill the application and the model-checker (which exits with `status`)*/
   XBT_ATTRIB_NORETURN void system_exit(int status);