diff options
author | Steve Harter <sharter@microsoft.com> | 2015-12-16 14:27:26 -0600 |
---|---|---|
committer | Steve Harter <sharter@microsoft.com> | 2016-01-21 15:23:16 -0600 |
commit | 00ac45086dd1f773431990f88336e44795c1fbe9 (patch) | |
tree | b2706ff87c19aef732aa10c37d08b51ce38006de /enablesanitizers.sh | |
parent | 2d2e591da6dac49bc762344430bf6c23257fcc79 (diff) | |
download | coreclr-00ac45086dd1f773431990f88336e44795c1fbe9.tar.gz coreclr-00ac45086dd1f773431990f88336e44795c1fbe9.tar.bz2 coreclr-00ac45086dd1f773431990f88336e44795c1fbe9.zip |
Reduce clr startup noise when using Clang sanitizers
Diffstat (limited to 'enablesanitizers.sh')
-rwxr-xr-x | enablesanitizers.sh | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/enablesanitizers.sh b/enablesanitizers.sh index 0afec5d1ee..70555aa70e 100755 --- a/enablesanitizers.sh +++ b/enablesanitizers.sh @@ -10,15 +10,17 @@ if [ $# -eq 0 ]; then echo " cd $(dirname $0);. enablesanitizers.sh [options]; cd -" fi echo "Usage: [asan] [ubsan] [lsan] [all] [off] [clangx.y]" - echo "asan: optional argument to enable Address Sanitizer." - echo "ubsan: optional argument to enable Undefined Behavior Sanitizer." - echo "lsan - optional argument to enable memory Leak Sanitizer." - echo "all - optional argument to enable asan, ubsan and lsan." - echo "off - optional argument to turn off all sanitizers." - echo "clangx.y - optional argument to specify clang version x.y. which is used to resolve stack traces." + echo " asan: optional argument to enable Address Sanitizer." + echo " ubsan: optional argument to enable Undefined Behavior Sanitizer." + echo " lsan - optional argument to enable memory Leak Sanitizer." + echo " all - optional argument to enable asan, ubsan and lsan." + echo " off - optional argument to turn off all sanitizers." + echo " clangx.y - optional argument to specify clang version x.y. which is used to resolve stack traces. Default is 3.6" else + # default to clang 3.6 instead of 3.5 because it supports print_stacktrace (otherwise only one stack frame) __ClangMajorVersion=3 - __ClangMinorVersion=5 + __ClangMinorVersion=6 + __EnableASan=0 __EnableUBSan=0 __EnableLSan=0 @@ -69,7 +71,10 @@ else unset DEBUG_SANITIZERS echo "Setting DEBUG_SANITIZERS=" else - ASAN_OPTIONS="symbolize=1" + # for now, specify alloc_dealloc_mismatch=0 as there are too many error reports that are not an issue + ASAN_OPTIONS="symbolize=1 alloc_dealloc_mismatch=0" + # when Clang 3.8 available, add: suppressions=$(readlink -f sanitizersuppressions.txt) + UBSAN_OPTIONS="print_stacktrace=1" if [ $__EnableASan == 1 ]; then __Options="$__Options asan" @@ -91,10 +96,15 @@ else export ASAN_OPTIONS echo "Setting ASAN_OPTIONS=$ASAN_OPTIONS" + UBSAN_OPTIONS="\"$UBSAN_OPTIONS\"" + export UBSAN_OPTIONS + echo "Setting UBSAN_OPTIONS=$UBSAN_OPTIONS" + # used by ASan at run-time ASAN_SYMBOLIZER_PATH="/usr/bin/llvm-symbolizer-$__ClangMajorVersion.$__ClangMinorVersion" export ASAN_SYMBOLIZER_PATH echo "Setting ASAN_SYMBOLIZER_PATH=$ASAN_SYMBOLIZER_PATH" + echo "Done. You can now run: build.sh Debug clang$__ClangMajorVersion.$__ClangMinorVersion" fi unset __ClangMajorVersion |