Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix get_object_info
authorGabriel Corona <gabriel.corona@loria.fr>
Mon, 17 Feb 2014 14:17:23 +0000 (15:17 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 18 Feb 2014 10:40:12 +0000 (11:40 +0100)
Some part of the RW segment was not included (the .bss).

src/mc/mc_checkpoint.c

index 6e3508b..38fb332 100644 (file)
@@ -313,6 +313,12 @@ static void MC_find_object_address(memory_map_t maps, mc_object_info_t result) {
             maps->regions[i].pathname);
           result->start_rw = reg.start_addr;
           result->end_rw   = reg.end_addr;
+          // .bss is usually after the .data:
+          // TODO, use dl_iterate_phdr to be more robust
+          s_map_region_t* next = &(maps->regions[i+1]);
+          if(next->pathname == NULL && (next->prot & PROT_WRITE) && next->start_addr == reg.end_addr) {
+            result->end_rw = maps->regions[i+1].end_addr;
+          }
     } else if ((reg.prot & PROT_READ) && (reg.prot & PROT_EXEC)){
           xbt_assert(!result->start_exec,
             "Multiple executable segments for %s, not supported",