llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27k stars 11.06k forks source link

SanitizerCommon.SizeClassAllocator32Iteration FAIL on Solaris/sparcv9 #47546

Open rorth opened 3 years ago

rorth commented 3 years ago
Bugzilla Link 48202
Version unspecified
OS Solaris
CC @vitalybuka

Extended Description

With sanitizer_common testing enabled on Solaris/sparcv9, two tests FAIL:

SanitizerCommon-Unit :: ./Sanitizer-sparcv9-Test/SanitizerCommon.SizeClassAllocator32Iteration

/vol/llvm/src/llvm-project/local/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cpp:920: Failure Expected: (reported_chunks.find(reinterpret_cast(allocated[i]))) != (reported_chunks.end()), actual: 8-byte object <FF-FF FF-FF 7F-FF 18-A8> vs 8-byte object <FF-FF FF-FF 7F-FF 18-A8>

SanitizerCommon-Unit :: ./Sanitizer-sparcv9-Test/SanitizerCommon.CombinedAllocator32Compact

/vol/llvm/src/llvm-project/local/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cpp:665: Failure Expected: (reported_chunks.find(allocated_ptr)) != (reported_chunks.end()), actual: 8-byte object <FF-FF FF-FF 7F-FE FA-08> vs 8-byte object <FF-FF FF-FF 7F-FE FA-08>

I've made absolutely no progress understanding what's going on, even after enabling the tests in a Debug build. However, I do notice SANITIZER_MMAP_RANGE_SIZE in sanitizer_platform.h: the value used there is wrong: Solaris/sparcv9 uses the full 64-bit address space:

https://docs.oracle.com/cd/E37838_01/html/E66175/advanced-2.html#SSFDGadvanced-5

but changing the definititon to

define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 64)

obviously doesn't even compile. Even reducing it to 1ULL << 63 for a test causes large numbers of tests to FAIL: Solaris doesn't allocate lazily, but requires VM to be backed by swap, which created OOM conditions all along the way.

I have a patch to just disable those two tests.

rorth commented 3 years ago

Patch submitted: https://reviews.llvm.org/D91622.