[PATCH] D32190: Make sure to scan mmap'd memory regions for root pointers on OS X

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 10:33:20 PDT 2017


kubamracek added inline comments.


================
Comment at: lib/lsan/lsan_common_mac.cc:149-156
+    // This additional root region scan is required on Darwin in order to
+    // detect root regions contained within mmap'd memory regions
+    if (flags()->use_root_regions) {
+      for (uptr i = 0; i < root_regions->size(); i++) {
+        ScanRootRegion(frontier, (*root_regions)[i], address, end_address,
+                       info.protection);
+      }
----------------
Why is this needed again?  I thought that we only need to account for the VM_MEMORY_OS_ALLOC_ONCE region.

Are we doing something like that on Linux?  Why do we need to scan all mmap'd regions on Darwin only?


https://reviews.llvm.org/D32190





More information about the llvm-commits mailing list