Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix bug in mmalloc_compare_heap() when a ungragmented block is handled as a...
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 26 Aug 2014 11:10:50 +0000 (13:10 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 26 Aug 2014 11:25:39 +0000 (13:25 +0200)
This bug was introduced by the commit of MMALLOC_TYPE_HEAPINFO.

src/mc/mc_diff.c

index bbda6d5..988d8b5 100644 (file)
@@ -600,6 +600,12 @@ int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2)
             continue;
           }
 
+          // We currently do not match fragments with unfragmented blocks (maybe we should).
+          if (heapinfo2b->type == MMALLOC_TYPE_UNFRAGMENTED) {
+            i2++;
+            continue;
+          }
+
           if (heapinfo2b->type < 0) {
             fprintf(stderr, "Unkown mmalloc block type.\n");
             abort();