summaryrefslogtreecommitdiff
path: root/libsanitizer/tsan/tsan_platform_mac.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libsanitizer/tsan/tsan_platform_mac.cc')
-rw-r--r--libsanitizer/tsan/tsan_platform_mac.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/libsanitizer/tsan/tsan_platform_mac.cc b/libsanitizer/tsan/tsan_platform_mac.cc
index 8eb22fa58ea..14395ba614a 100644
--- a/libsanitizer/tsan/tsan_platform_mac.cc
+++ b/libsanitizer/tsan/tsan_platform_mac.cc
@@ -229,7 +229,7 @@ static void my_pthread_introspection_hook(unsigned int event, pthread_t thread,
void InitializePlatformEarly() {
#if defined(__aarch64__)
- uptr max_vm = GetMaxVirtualAddress() + 1;
+ uptr max_vm = GetMaxUserVirtualAddress() + 1;
if (max_vm != Mapping::kHiAppMemEnd) {
Printf("ThreadSanitizer: unsupported vm address limit %p, expected %p.\n",
max_vm, Mapping::kHiAppMemEnd);
@@ -238,6 +238,9 @@ void InitializePlatformEarly() {
#endif
}
+static const uptr kPthreadSetjmpXorKeySlot = 0x7;
+extern "C" uptr __tsan_darwin_setjmp_xor_key = 0;
+
void InitializePlatform() {
DisableCoreDumperIfNecessary();
#if !SANITIZER_GO
@@ -249,6 +252,11 @@ void InitializePlatform() {
prev_pthread_introspection_hook =
pthread_introspection_hook_install(&my_pthread_introspection_hook);
#endif
+
+ if (GetMacosVersion() >= MACOS_VERSION_MOJAVE) {
+ __tsan_darwin_setjmp_xor_key =
+ (uptr)pthread_getspecific(kPthreadSetjmpXorKeySlot);
+ }
}
#if !SANITIZER_GO