[PATCH] D66616: [TSan] Add interceptors for mach_vm_[de]allocate
Kuba (Brecka) Mracek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 23 15:23:12 PDT 2019
kubamracek added inline comments.
================
Comment at: compiler-rt/lib/tsan/rtl/tsan_interceptors.cpp:748-749
+// Zero out addr if it points into shadow memory and was provided as a hint
+// only, i.e., MAP_FIXED is not set.
static bool fix_mmap_addr(void **addr, long_t sz, int flags) {
----------------
is this related? or just a co-incidental change?
================
Comment at: compiler-rt/lib/tsan/rtl/tsan_interceptors_mach_vm.cpp:42-45
+ if (thr->ignore_reads_and_writes == 0)
+ MemoryRangeImitateWrite(thr, pc, *address, size);
+ else
+ MemoryResetRange(thr, pc, *address, size);
----------------
This is copied from mmap, right? Can it be extracted into a common function instead?
================
Comment at: compiler-rt/lib/tsan/rtl/tsan_interceptors_mach_vm.cpp:58-62
+ // If size == 0, mach_vm_deallocate will return KERN_SUCCESS and does not
+ // deallocate any memory.
+ DontNeedShadowFor(address, size);
+ ScopedGlobalProcessor sgp;
+ ctx->metamap.ResetRange(thr->proc(), address, size);
----------------
ditto here
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66616/new/
https://reviews.llvm.org/D66616
More information about the llvm-commits
mailing list