Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://github.com/mpoquet/simgrid
[simgrid.git] / src / mc / mc_checkpoint.cpp
index 04f995e..d6e234c 100644 (file)
@@ -246,13 +246,13 @@ void find_object_address(
   }
 
   result->start = result->start_rw;
-  if ((const void*) result->start_ro > result->start)
+  if ((const void*) result->start_ro < result->start)
     result->start = result->start_ro;
-  if ((const void*) result->start_exec > result->start)
+  if ((const void*) result->start_exec < result->start)
     result->start = result->start_exec;
 
   result->end = result->end_rw;
-  if (result->end_ro && (const void*) result->end_ro < result->end)
+  if (result->end_ro && (const void*) result->end_ro > result->end)
     result->end = result->end_ro;
   if (result->end_exec && (const void*) result->end_exec > result->end)
     result->end = result->end_exec;
@@ -527,7 +527,7 @@ static std::vector<s_fd_infos_t> get_current_fds(pid_t pid)
 
     // We don't handle them.
     // It does not mean we should silently ignore them however.
-    if (strncmp(link, "pipe:", 5) == 0 || strncmp(link, "socket:", 7) == 0)
+    if (strncmp(link, "pipe:", std::strlen("pipe:")) == 0 || strncmp(link, "socket:", std::strlen("socket:")) == 0)
       continue;
 
     // If dot_output enabled, do not handle the corresponding file
@@ -541,7 +541,7 @@ static std::vector<s_fd_infos_t> get_current_fds(pid_t pid)
     }
 
     // This is probably a shared memory used by lttng-ust:
-    if(strncmp("/dev/shm/ust-shm-tmp-", link, 21)==0)
+    if(strncmp("/dev/shm/ust-shm-tmp-", link, std::strlen("/dev/shm/ust-shm-tmp-"))==0)
       continue;
 
     // Add an entry for this FD in the snapshot:
@@ -569,7 +569,7 @@ std::shared_ptr<simgrid::mc::Snapshot> take_snapshot(int num_state)
   snapshot->num_state = num_state;
 
   for (auto& p : mc_model_checker->process().simix_processes())
-    snapshot->enabled_processes.insert(p.copy.pid);
+    snapshot->enabled_processes.insert(p.copy.getBuffer()->pid);
 
   snapshot_handle_ignore(snapshot.get());
 
@@ -618,8 +618,7 @@ void restore_snapshot_regions(simgrid::mc::Snapshot* snapshot)
 static inline
 void restore_snapshot_fds(simgrid::mc::Snapshot* snapshot)
 {
-  if (mc_mode == MC_MODE_SERVER)
-    xbt_die("FD snapshot not implemented in client/server mode.");
+  xbt_die("FD snapshot not implemented in client/server mode.");
 
   for (auto const& fd : snapshot->current_fds) {