Skip to content

[asan][sanitizer_common][AIX] Set allocator size and beginning #144784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler-rt/lib/asan/asan_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ const uptr kAllocatorSpace = ~(uptr)0;
# endif // SANITIZER_APPLE

# if defined(__powerpc64__)
# if SANITIZER_AIX
const uptr kAllocatorSize = 1ULL << 38; // 256G.
# else
const uptr kAllocatorSize = 0x20000000000ULL; // 2T.
# endif
typedef DefaultSizeClassMap SizeClassMap;
# elif defined(__aarch64__) && SANITIZER_ANDROID
// Android needs to support 39, 42 and 48 bit VMA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ namespace __sanitizer {
typedef CompactSizeClassMap InternalSizeClassMap;

struct AP32 {
// For AIX 64-bit, the mmap begin is at address 0x0a00000000000000ULL.
#if SANITIZER_AIX && SANITIZER_WORDSIZE == 64
static const uptr kSpaceBeg = 0x0a00000000000000ULL;
#else
static const uptr kSpaceBeg = 0;
#endif
static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE;
static const uptr kMetadataSize = 0;
typedef InternalSizeClassMap SizeClassMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ class SizeClassAllocator32 {
uptr ComputeRegionId(uptr mem) const {
if (SANITIZER_SIGN_EXTENDED_ADDRESSES)
mem &= (kSpaceSize - 1);
mem -= kSpaceBeg;
const uptr res = mem >> kRegionSizeLog;
CHECK_LT(res, kNumPossibleRegions);
return res;
Expand Down
Loading