This only happens on a 64-bit platform that uses SizeClassAllocator32 (e.g. ASan on AArch64). When querying a large invalid pointer about its size, e.g. with:
__sanitizer_get_allocated_size(0xdeadbeefdeadbeef);
...an assertion will fail:
AddressSanitizer CHECK failed: .../sanitizer_allocator.h "((res)) < ((kNumPossibleRegions))"
This patch changes PointerIsMine to return false if the pointer is outside of [kSpaceBeg, kSpaceBeg + kSpaceSize).
The condition in GetSizeClass->ComputeRegionId is different. It effectively checks that mem < kSpaceSize.
At least ComputeRegionId assumes that kSpaceBeg==0. We seem to be missing some tests.
Kostya?