This is an archive of the discontinued LLVM Phabricator instance.

[asan] Add fallback for Thumb after r350139
ClosedPublic

Authored by rovka on Jan 11 2019, 4:52 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

rovka created this revision.Jan 11 2019, 4:52 AM
krytarowski accepted this revision.Jan 11 2019, 9:04 AM
This revision is now accepted and ready to land.Jan 11 2019, 9:04 AM
krytarowski added inline comments.Jan 11 2019, 9:42 AM
lib/asan/asan_rtl.cc
386 ↗(On Diff #181245)

I would prefer to additionally specify Linux here, but for now it's good enough.

krytarowski added inline comments.Jan 11 2019, 11:26 AM
lib/asan/asan_rtl.cc
386 ↗(On Diff #181245)

Or maybe even better (feel free to pick a better symbol name):

#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() {
[...]
MaybeStartBackgroudThread();
SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback);
[...]
}

BTW. Does it work on thumb if we use here:

 __attribute__((constructor))
void __local_asan_dyninit() {
  MaybeStartBackgroudThread();
  SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback);
}
rovka marked an inline comment as done.Jan 14 2019, 1:47 AM

Thanks for the review, I'll commit with your suggestions in place.

lib/asan/asan_rtl.cc
386 ↗(On Diff #181245)

The constructor attribute doesn't work (in fact it breaks even on arm, and in more tests than before).

This revision was automatically updated to reflect the committed changes.
krytarowski added inline comments.Jan 14 2019, 1:50 AM
lib/asan/asan_rtl.cc
386 ↗(On Diff #181245)

This means that something is really wrong. Feel free to land this patch or the proposed one with START_BACKGROUND_THREAD_IN_ASAN_INTERNAL.