Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Read context from remote process in MC_take_snapshot_stacks()
authorGabriel Corona <gabriel.corona@loria.fr>
Fri, 27 Mar 2015 10:44:50 +0000 (11:44 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Fri, 27 Mar 2015 10:54:37 +0000 (11:54 +0100)
src/mc/mc_checkpoint.c
src/mc/mc_global.c

index 6c06f80..b2a0538 100644 (file)
@@ -536,11 +536,14 @@ static xbt_dynar_t MC_take_snapshot_stacks(mc_snapshot_t * snapshot)
   xbt_dynar_foreach(stacks_areas, cursor, current_stack) {
     mc_snapshot_stack_t st = xbt_new(s_mc_snapshot_stack_t, 1);
 
-    unw_context_t* original_context = (unw_context_t*) current_stack->context;
+    // Read the context from remote process:
+    unw_context_t context;
+    MC_process_read_simple(&mc_model_checker->process,
+      &context, (unw_context_t*) current_stack->context, sizeof(context));
 
     st->context = xbt_new0(s_mc_unw_context_t, 1);
     if (mc_unw_init_context(st->context, &mc_model_checker->process,
-      original_context) < 0) {
+      &context) < 0) {
       xbt_die("Could not initialise the libunwind context.");
     }
 
index 10f95d2..da02e1d 100644 (file)
@@ -766,6 +766,7 @@ void MC_automaton_new_propositional_symbol_callback(const char* id,
   mmalloc_set_current_heap(heap);
 }
 
+// TODO, fix cross-process access (this function is not used)
 void MC_dump_stacks(FILE* file)
 {
   xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);