[PATCH] D32190: Make sure to scan mmap'd memory regions for root pointers on OS X
Francis Ricci via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 19 10:35:56 PDT 2017
fjricci 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);
+ }
----------------
kubamracek wrote:
> 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?
It appears that the Linux implementation of `MemoryMappingLayout` from sanitizer_procmaps includes mmap'd regions, while the Darwin implementation does not. I'm not sure whether that's because mmap-ing works differently on Darwin, or if it's a result of the differences between how we generate the module listing.
https://reviews.llvm.org/D32190
More information about the llvm-commits
mailing list