[PATCH] D46459: [asan] On RTEMS, checks for asan_inited before entering ASan run-time
Walter Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 17 18:01:23 PDT 2018
waltl added inline comments.
================
Comment at: compiler-rt/lib/asan/asan_fake_stack.cc:197
+ return nullptr;
if (FakeStack *fs = GetTLSFakeStack())
return fs;
----------------
vitalybuka wrote:
> GetTLSFakeStack probably will return 0 anyway?
GetTLSFakeStack is currently not enabled for RTEMS. But regardless, the problem is that thread locals don't work for instrumented code during booting, before ASan compiler-rt has been initialized. Both this entry point and the one in __asan_handle_no_return eventually access TLS (either through GetTLSFakeStack or GetCurrentThread) which would crash the program.
Maybe I should put the check in GetCurrentThread so that it returns NULL instead of crash when !asan_inited? I can put together a patch based on that.
Repository:
rL LLVM
https://reviews.llvm.org/D46459
More information about the llvm-commits
mailing list