As in D114934, or lsan crashes on the same bot.
allocator_options.SetFrom(flags(), common_flags());
InitializeAllocator(allocator_options);
+ if (SANITIZER_START_BACKGROUND_THREAD_IN_ASAN_INTERNAL)
+ MaybeStartBackgroudThread();
+
// On Linux AsanThread::ThreadStart() calls malloc() that's why asan_inited
// should be set to 1 prior to initializing the threads.
asan_inited = 1;
void SetAllocatorMayReturnNull(bool may_return_null) {
atomic_store(&allocator_may_return_null, may_return_null,
memory_order_relaxed);
- if (SANITIZER_START_BACKGROUND_THREAD_IN_ASAN_INTERNAL)
- MaybeStartBackgroudThread();
}
void PrintHintAllocatorCannotReturnNull() {
} background_thread_strarter UNUSED;
# pragma clang diagnostic pop
# endif
+#else
+void MaybeStartBackgroudThread() {}
#endif
void WriteToSyslog(const char *msg) {
#if defined(__thumb__) && defined(__linux__)
// Workaround for
// https://lab.llvm.org/buildbot/#/builders/clang-thumbv7-full-2stage
+// or
+// https://lab.llvm.org/staging/#/builders/clang-thumbv7-full-2stage
+// It fails *rss_limit_mb_test* without meaningful errors.
# define SANITIZER_START_BACKGROUND_THREAD_IN_ASAN_INTERNAL 1
#else
# define SANITIZER_START_BACKGROUND_THREAD_IN_ASAN_INTERNAL 0
// Ubsan does not intercept pthread_create.
// XFAIL: ubsan
+// THUMB starts background thead only for Asan.
+// XFAIL: thumb && !asan
+
// https://github.com/google/sanitizers/issues/981
// UNSUPPORTED: android-26
// XFAIL: ubsan
// UNSUPPORTED: freebsd, solaris, darwin
+// THUMB starts background thead only for Asan.
+// XFAIL: thumb && !asan
+
#include <string.h>
#include <stdio.h>
#include <unistd.h>