From: Fangrui Song Date: Wed, 28 Jun 2023 04:17:34 +0000 (-0700) Subject: sanitizer_allocator_test: guard SpecialSizeClassMap test with !ALLOCATOR64_SMALL_SIZE X-Git-Tag: upstream/17.0.6~3614 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dcef530878e870cd72479e7ecda6b059ebe00175;p=platform%2Fupstream%2Fllvm.git sanitizer_allocator_test: guard SpecialSizeClassMap test with !ALLOCATOR64_SMALL_SIZE This artificial size class map uses a very large kMaxSize (1<<34) which is not suitable for small kAddressSpaceSize systems (aarch64-*-linux-android, riscv64). Exposed by D153664. --- diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cpp index 3b87eba..58f2c8f 100644 --- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cpp +++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cpp @@ -1094,7 +1094,7 @@ TEST(SanitizerCommon, LargeMmapAllocatorBlockBegin) { // Don't test OOM conditions on Win64 because it causes other tests on the same // machine to OOM. -#if SANITIZER_CAN_USE_ALLOCATOR64 && !SANITIZER_WINDOWS64 +#if SANITIZER_CAN_USE_ALLOCATOR64 && !SANITIZER_WINDOWS64 && !ALLOCATOR64_SMALL_SIZE typedef __sanitizer::SizeClassMap<2, 22, 22, 34, 128, 16> SpecialSizeClassMap; template struct AP64_SpecialSizeClassMap { @@ -1122,7 +1122,7 @@ TEST(SanitizerCommon, SizeClassAllocator64PopulateFreeListOOM) { // ...one man is on a mission to overflow a region with a series of // successive allocations. - const uptr kClassID = ALLOCATOR64_SMALL_SIZE ? 18 : 24; + const uptr kClassID = 24; const uptr kAllocationSize = SpecialSizeClassMap::Size(kClassID); ASSERT_LT(2 * kAllocationSize, kRegionSize); ASSERT_GT(3 * kAllocationSize, kRegionSize); @@ -1130,7 +1130,7 @@ TEST(SanitizerCommon, SizeClassAllocator64PopulateFreeListOOM) { EXPECT_NE(cache.Allocate(a, kClassID), nullptr); EXPECT_EQ(cache.Allocate(a, kClassID), nullptr); - const uptr Class2 = ALLOCATOR64_SMALL_SIZE ? 15 : 21; + const uptr Class2 = 21; const uptr Size2 = SpecialSizeClassMap::Size(Class2); ASSERT_EQ(Size2 * 8, kRegionSize); char *p[7];