diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-08-21 20:49:37 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-08-21 20:49:37 +0000 |
commit | 23b3d26ca5e3f782373f73620d7872dc0fc1c0b2 (patch) | |
tree | c0cc0f0de1a49054359e7b85e7f3d1fb6eeef180 /lib/asan/asan_rtl.cc | |
parent | 564ca11c1e257ea6207a50bbfe36be4ecc29fe5f (diff) |
[Sanitizers] Unify the semantics and usage of "exitcode" runtime flag across all sanitizers.
Summary:
Merge "exitcode" flag from ASan, LSan, TSan and "exit_code" from MSan
into one entity. Additionally, make sure sanitizer_common now uses the
value of common_flags()->exitcode when dying on error, so that this
flag will automatically work for other sanitizers (UBSan and DFSan) as
well.
User-visible changes:
* "exit_code" MSan runtime flag is now deprecated. If explicitly
specified, this flag will take precedence over "exitcode".
The users are encouraged to migrate to the new version.
* __asan_set_error_exit_code() and __msan_set_exit_code() functions
are removed. With few exceptions, we don't support changing runtime
flags during program execution - we can't make them thread-safe.
The users should use __sanitizer_set_death_callback()
that would call _exit() with proper exit code instead.
* Plugin tools (LSan and UBSan) now inherit the exit code of the parent
tool. In particular, this means that ASan would now crash the program
with exit code "1" instead of "23" if it detects leaks.
Reviewers: kcc, eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D12120
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_rtl.cc')
-rw-r--r-- | lib/asan/asan_rtl.cc | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc index 7ff657bc5..ad5a8eb98 100644 --- a/lib/asan/asan_rtl.cc +++ b/lib/asan/asan_rtl.cc @@ -60,7 +60,6 @@ static void AsanDie() { __sanitizer_cov_dump(); if (flags()->abort_on_error) Abort(); - internal__exit(flags()->exitcode); } static void AsanCheckFailed(const char *file, int line, const char *cond, @@ -267,7 +266,6 @@ static NOINLINE void force_interface_symbols() { case 30: __asan_address_is_poisoned(0); break; case 31: __asan_poison_memory_region(0, 0); break; case 32: __asan_unpoison_memory_region(0, 0); break; - case 33: __asan_set_error_exit_code(0); break; case 34: __asan_before_dynamic_init(0); break; case 35: __asan_after_dynamic_init(); break; case 36: __asan_poison_stack_memory(0, 0); break; @@ -550,12 +548,6 @@ static AsanInitializer asan_initializer; // ---------------------- Interface ---------------- {{{1 using namespace __asan; // NOLINT -int NOINLINE __asan_set_error_exit_code(int exit_code) { - int old = flags()->exitcode; - flags()->exitcode = exit_code; - return old; -} - void NOINLINE __asan_handle_no_return() { int local_stack; AsanThread *curr_thread = GetCurrentThread(); |