Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix bug when parsing /proc/self/maps
authorGabriel Corona <gabriel.corona@loria.fr>
Fri, 20 Dec 2013 11:58:13 +0000 (12:58 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Fri, 20 Dec 2013 12:38:17 +0000 (13:38 +0100)
Sometimes, the heap is not found by the MC :

* the MC expects the heap to be anonymous/unlabelled in
  /proc/self/maps;

* the heap may be labelled as as [stack:$tid] in /proc/self/maps at
  some instants of the execution of the program because the tasks
  stacks are allocated on the heap.

src/mc/mc_checkpoint.c

index 2b2fe9d..42c23fd 100644 (file)
@@ -177,7 +177,7 @@ static void MC_get_memory_regions(mc_snapshot_t snapshot){
               }
               tok = strtok(lfields[0], "-");
               start_addr1 = (void *)strtoul(tok, NULL, 16);
               }
               tok = strtok(lfields[0], "-");
               start_addr1 = (void *)strtoul(tok, NULL, 16);
-              if(lfields[1][1] == 'w' && lfields[5] == NULL){
+              if(lfields[1][1] == 'w'){
                 if(start_addr1 == std_heap){     /* Std_heap ? */
                   tok = strtok(NULL, "-");
                   end_addr = (void *)strtoul(tok, NULL, 16);
                 if(start_addr1 == std_heap){     /* Std_heap ? */
                   tok = strtok(NULL, "-");
                   end_addr = (void *)strtoul(tok, NULL, 16);