[PATCH] D105629: [TSan] Add SystemZ support

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 23:11:48 PDT 2021


dvyukov added a comment.

Some solid work here.

I only have a question re mmap handling.



================
Comment at: compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:781
+      // TSAN. Act as if we ran out of memory.
+      internal_munmap(res, sz);
+      errno = errno_ENOMEM;
----------------
TSan runtime is supposed to mprotect all ranges that are inaccessible to the application. How does it happen that kernel still returns such an address? Do we fail to mprotect all ranges on s390? If so should that be fixed instead?
I am concerned that if kernel can return unsupported addresses, it probably can returns them very early before exhausting all supported addresses (e.g. always return unsupported from the start).
Or is it that we mprotect everything, but kernel still somehow stomps on it? If so can this address overlap with, say, tsan shadow? If yes, them the munmap will unmap our shadow which is not good.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105629



More information about the llvm-commits mailing list