[PATCH] D55874: [asan] Support running without /proc.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 17:54:16 PST 2018


eugenis added inline comments.


================
Comment at: compiler-rt/lib/asan/asan_thread.cc:302
+    GetThreadStackAndTls(tid() == 0, const_cast<uptr *>(&stack_bottom_),
+                         const_cast<uptr *>(&stack_size), &tls_begin_,
+                         &tls_size);
----------------
vitalybuka wrote:
> I dont see why const_cast is needed here
Yeah. Removed in a separate commit.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc:147
 
+bool MemoryMappingLayout::IsAvailable(bool cache_enabled) {
+  if (cache_enabled && cached_proc_self_maps.data)
----------------
vitalybuka wrote:
> what is the purpose of cache_enabled?
> It's always true
> also to return false, it needs to always get to IsProcMapsAvailable()
The same as in MemoryMappingLayout constructor - some users are ok with old, cached mappings, some are not. The cache is used to support sandboxing - a situation where /proc/self/maps has been accessible before, but not right now.  In that case IsAvailable(true) will say yes if there is cached data.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55874/new/

https://reviews.llvm.org/D55874





More information about the llvm-commits mailing list