[PATCH] Make caching of memory mappings in sanitizer_procmaps optional

Alexander Potapenko glider at google.com
Fri Mar 22 05:01:54 PDT 2013



================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:338
@@ -331,1 +337,3 @@
+
+void MemoryMappingLayout::Init(bool update_cache) {
   proc_self_maps_.len =
----------------
If we want ASan and LSan work together in one process we must keep in mind that the cache is always invalid from LSan's point of view, but still can be valid for ASan.
I think it's better to construct MemoryMappingLayout with a flag that enables/disables LoadFromCache().
We'll then use MemoryMappingLayout(/*use_cache*/true) for ASan and MemoryMappingLayout(/*use_cache*/false) for LSan.

================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:348
@@ -339,3 +347,3 @@
   Reset();
-  // FIXME: in the future we may want to cache the mappings on demand only.
-  CacheMemoryMappings();
+  if (update_cache)
+    CacheMemoryMappings();
----------------
Please keep the FIXME comment. Never remove FIXME if something isn't actually fixed.


http://llvm-reviews.chandlerc.com/D569



More information about the llvm-commits mailing list