[PATCH] Make caching of memory mappings in sanitizer_procmaps optional

Sergey Matveev earthdok at google.com
Fri Mar 22 10:07:34 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 =
----------------
Alexander Potapenko wrote:
> 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.
Fixed.

================
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();
----------------
Alexander Potapenko wrote:
> Please keep the FIXME comment. Never remove FIXME if something isn't actually fixed.
Sorry - I read the comment wrong and thought my patch fixed it.


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



More information about the llvm-commits mailing list