From a53ea51dec34e0825bc44d7789e904964c4105ff Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 11 Mar 2022 20:16:17 -0800 Subject: [PATCH] [lsan] ppc64: dynamically pick address range for allocator For ppc64 PIE, it seems that [0xa00000000000,0xc00000000000) may be occupied which will lead to a segfault in certain kernel configurations (clang-ppc64le-rhel). Use the `!kUsingConstantSpaceBeg` code path like Fuchsia. Reviewed By: jsji Differential Revision: https://reviews.llvm.org/D121257 --- compiler-rt/lib/lsan/lsan_allocator.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler-rt/lib/lsan/lsan_allocator.h b/compiler-rt/lib/lsan/lsan_allocator.h index 45c6ac4..5393304 100644 --- a/compiler-rt/lib/lsan/lsan_allocator.h +++ b/compiler-rt/lib/lsan/lsan_allocator.h @@ -66,12 +66,9 @@ template using PrimaryAllocatorASVT = SizeClassAllocator32>; using PrimaryAllocator = PrimaryAllocatorASVT; #elif defined(__x86_64__) || defined(__powerpc64__) || defined(__s390x__) -# if SANITIZER_FUCHSIA +# if SANITIZER_FUCHSIA || defined(__powerpc64__) const uptr kAllocatorSpace = ~(uptr)0; const uptr kAllocatorSize = 0x40000000000ULL; // 4T. -# elif defined(__powerpc64__) -const uptr kAllocatorSpace = 0xa0000000000ULL; -const uptr kAllocatorSize = 0x20000000000ULL; // 2T. #elif defined(__s390x__) const uptr kAllocatorSpace = 0x40000000000ULL; const uptr kAllocatorSize = 0x40000000000ULL; // 4T. -- 2.7.4