Open GoogleCodeExporter opened 9 years ago
Do I understand correctly that on AArch64/iOS SANITIZER_MMAP_RANGE_SIZE is 2Gb?
So both definitions are incorrect for that platform, right?
Original comment by konstant...@gmail.com
on 24 Feb 2014 at 2:10
Should SANITIZER_MMAP_RANGE_SIZE be defined as the upper bound of allocatable
memory, or the difference between the upper and lower bound? I don't remember a
comment in the code defining it.
For the former, it is 6.5 GB, and the latter, it is 2.5 GB.
Original comment by rgovostes
on 24 Feb 2014 at 8:54
So, on iOS/AArch64 a user program can map addresses between 4G and 6.5Gb, right?
Since this is so small, I suggest you to use FlatByteMap:
--- lib/sanitizer_common/sanitizer_allocator_internal.h (revision 202117)
+++ lib/sanitizer_common/sanitizer_allocator_internal.h (working copy)
@@ -25,7 +25,7 @@
static const uptr kInternalAllocatorSpace = 0;
static const u64 kInternalAllocatorSize = SANITIZER_MMAP_RANGE_SIZE;
-#if SANITIZER_WORDSIZE == 32
+#if SANITIZER_MMAP_RANGE_SIZE < (1ULL << 36)
static const uptr kInternalAllocatorRegionSizeLog = 20;
static const uptr kInternalAllocatorNumRegions =
kInternalAllocatorSize >> kInternalAllocatorRegionSizeLog;
(You'll need to define SANITIZER_MMAP_RANGE_SIZE to 6.5Gb)
iOS/AArch64 is the first platform for asan where the mmap range does not start
around zero,
so SANITIZER_MMAP_RANGE_SIZE is supposed to be the upper bound of that range.
Anyway, this does not matter much if we use FlatByteMap.
If at some point we face a platform which has a small mmap range that starts at
huge address
(e.g. 2Gb starting at 40Tb), we'll need some refactoring. But not today.
Original comment by konstant...@gmail.com
on 25 Feb 2014 at 10:56
Original issue reported on code.google.com by
rgovostes
on 20 Feb 2014 at 12:56