Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
restore a warning when doing weird assumptions about the system
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 9 Sep 2016 22:58:26 +0000 (00:58 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 9 Sep 2016 22:58:26 +0000 (00:58 +0200)
src/xbt/memory_map.cpp

index 379a22e..35dba46 100644 (file)
@@ -123,10 +123,14 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
     if (memreg.prot == 0)
       memreg.prot |= PROT_NONE;
 
     if (memreg.prot == 0)
       memreg.prot |= PROT_NONE;
 
-    if (lfields[1][3] == 'p')
+    if (lfields[1][3] == 'p') {
       memreg.flags |= MAP_PRIVATE;
       memreg.flags |= MAP_PRIVATE;
-    else
+    } else {
       memreg.flags |= MAP_SHARED;
       memreg.flags |= MAP_SHARED;
+      if (lfields[1][3] != 's')
+       XBT_WARN("The protection is neither 'p' (private) nor 's' (shared) but '%s'. Let's assume shared, as on b0rken win-ubuntu systems.\nFull line: %s\n"
+                lfields[1], line);
+    }
 
     /* Get the offset value */
     memreg.offset = std::strtoull(lfields[2], &endptr, 16);
 
     /* Get the offset value */
     memreg.offset = std::strtoull(lfields[2], &endptr, 16);