[PATCH] D12120: [Sanitizers] Unify the semantics and usage of "exitcode" runtime flag across all sanitizers.

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 15:02:34 PDT 2015


samsonov created this revision.
samsonov added reviewers: kcc, eugenis.
samsonov added a subscriber: llvm-commits.

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()->exit_code when dying on error, so that this
flag will automatically work for other sanitizers (UBSan and DFSan) as
well.

*** User-visible changes ***
1) "exit_code" MSan runtime flag is removed in favor of "exitcode"
2) __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.
3) 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.

http://reviews.llvm.org/D12120

Files:
  include/sanitizer/asan_interface.h
  include/sanitizer/lsan_interface.h
  include/sanitizer/msan_interface.h
  lib/asan/asan_flags.cc
  lib/asan/asan_flags.inc
  lib/asan/asan_interface_internal.h
  lib/asan/asan_internal.h
  lib/asan/asan_report.cc
  lib/asan/asan_rtl.cc
  lib/asan/tests/asan_interface_test.cc
  lib/lsan/lsan.cc
  lib/lsan/lsan_common.cc
  lib/lsan/lsan_flags.inc
  lib/msan/msan.cc
  lib/msan/msan_flags.inc
  lib/msan/msan_interface_internal.h
  lib/msan/msan_linux.cc
  lib/sanitizer_common/sanitizer_common.cc
  lib/sanitizer_common/sanitizer_flags.inc
  lib/tsan/rtl/tsan_flags.cc
  lib/tsan/rtl/tsan_flags.inc
  lib/tsan/rtl/tsan_rtl.cc
  lib/tsan/rtl/tsan_rtl_report.cc
  lib/tsan/tests/unit/tsan_flags_test.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12120.32460.patch
Type: text/x-patch
Size: 14571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150818/799e3d44/attachment.bin>


More information about the llvm-commits mailing list