Skip to content

Commit

Permalink
[asan] Add fallback for Thumb after r350139
Browse files Browse the repository at this point in the history
This reverts r350806 which marked some tests as UNSUPPORTED on ARM and
instead reintroduces the old code path only for Thumb, since that seems
to be the only target that broke.

It would still be nice to find the root cause of the breakage, but with
the branch point for LLVM 8.0 scheduled for next week it's better to put
things in a stable state while we investigate.

Differential Revision: https://reviews.llvm.org/D56594

llvm-svn: 351040
  • Loading branch information
rovka committed Jan 14, 2019
1 parent 84f4ff5 commit 2e3aaed
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions compiler-rt/lib/asan/asan_rtl.cc
Expand Up @@ -383,12 +383,18 @@ void PrintAddressSpaceLayout() {
kHighShadowBeg > kMidMemEnd);
}

#if defined(__thumb__) && defined(__linux__)
#define START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
#endif

#ifndef START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
static bool UNUSED __local_asan_dyninit = [] {
MaybeStartBackgroudThread();
SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback);

return false;
}();
#endif

static void AsanInitInternal() {
if (LIKELY(asan_inited)) return;
Expand Down Expand Up @@ -464,6 +470,11 @@ static void AsanInitInternal() {
allocator_options.SetFrom(flags(), common_flags());
InitializeAllocator(allocator_options);

#ifdef START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
MaybeStartBackgroudThread();
SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback);
#endif

// On Linux AsanThread::ThreadStart() calls malloc() that's why asan_inited
// should be set to 1 prior to initializing the threads.
asan_inited = 1;
Expand Down
Expand Up @@ -7,7 +7,7 @@
// RUN: %env_asan_opts=hard_rss_limit_mb=20 not %run %t 2>&1 | FileCheck %s --check-prefix=RSS_LIMIT

// https://github.com/google/sanitizers/issues/981
// UNSUPPORTED: android-26, arm
// UNSUPPORTED: android-26

#include <string.h>
char *g;
Expand Down
Expand Up @@ -16,7 +16,7 @@
// XFAIL: msan
// XFAIL: ubsan

// UNSUPPORTED: freebsd, solaris, darwin, arm
// UNSUPPORTED: freebsd, solaris, darwin

#include <string.h>
#include <stdio.h>
Expand Down

0 comments on commit 2e3aaed

Please sign in to comment.