This is found during address sanitizer enablement on AIX.
On platforms that has no malloc/free calls before user's malloc/free
calls, `__sanitizer_get_current_allocated_bytes()` should return 0.
Otherwise the case like
`compiler-rt/test/sanitizer_common/TestCases/allocator_interface.cpp`
will fail at below scenario:
```
void Test(int size) {
auto allocated_bytes_before = __sanitizer_get_current_allocated_bytes();
int *p = (int *)malloc(size);
assert(__sanitizer_get_current_allocated_bytes() >=
size + allocated_bytes_before); // if allocated_bytes_before is 1, this assert will fail. allocated_bytes_before should be 0
}
```
Mutex does not support LINKER_INITIALIZED support.
As preparation to switching BlockingMutex to Mutex,
proactively replace all BlockingMutex(LINKER_INITIALIZED) to Mutex.
All of these are objects with static storage duration and Mutex ctor
is constexpr, so it should be equivalent.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D106944
This created an infinite loop that timed out several build bots while
executing the test in compiler-rt/test/asan/TestCases/atexit_stats.cpp
Differential Revision: https://reviews.llvm.org/D60243
llvm-svn: 369472
This patch fixes https://github.com/google/sanitizers/issues/703
On a Graviton-A1 aarch64 machine with 48-bit VMA,
the time spent in LSan and ASan reduced from 2.5s to 0.01s when running
clang -fsanitize=leak compiler-rt/test/lsan/TestCases/sanity_check_pure_c.c && time ./a.out
clang -fsanitize=address compiler-rt/test/lsan/TestCases/sanity_check_pure_c.c && time ./a.out
With this patch, LSan and ASan create both the 32 and 64 allocators and select
at run time between the two allocators following a global variable that is
initialized at init time to whether the allocator64 can be used in the virtual
address space.
Differential Revision: https://reviews.llvm.org/D60243
llvm-svn: 369441