From 3879c1016270ce319eb001732b72dc7d2144b74c Mon Sep 17 00:00:00 2001 From: teor Date: Thu, 11 Jun 2015 00:59:04 +1000 Subject: [PATCH] Tweak clang sanitizer blacklist for out-of-tree builds, make, ccache Avoid using file names and file paths for compatibility with out-of-tree builds. Note make and ccache don't track blacklist dependencies, add workarounds. --- contrib/clang/sanitize_blacklist.txt | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/contrib/clang/sanitize_blacklist.txt b/contrib/clang/sanitize_blacklist.txt index d4f6cf6298..03d1e70f31 100644 --- a/contrib/clang/sanitize_blacklist.txt +++ b/contrib/clang/sanitize_blacklist.txt @@ -29,6 +29,9 @@ # It has not been tested with ThreadSanitizer or MemorySanitizer # Success report and patches for other sanitizers or OSs are welcome +# ccache and make don't account for the sanitizer blacklist as a dependency +# you might need to set CCACHE_DISABLE=1 and/or use make clean to workaround + # Configuration Flags: # -fno-sanitize-recover=all # causes clang to crash on undefined behavior, rather than printing @@ -67,23 +70,23 @@ # Blacklist Entries: +# test-memwipe.c checks if a freed buffer was properly wiped +fun:vmemeq +fun:check_a_buffer + # we need to allow the tor bt handler to catch SIGSEGV # otherwise address sanitizer munges the expected output and the test fails # we can do this by setting an environmental variable # See https://code.google.com/p/address-sanitizer/wiki/Flags # ASAN_OPTIONS=allow_user_segv_handler=1 -# test-memwipe.c checks if a freed buffer was properly wiped -fun:vmemeq -fun:check_a_buffer - # test_bt_cl.c stores to a NULL pointer to trigger a crash fun:crash # curve25519-donna.c left-shifts 1 bits into and past the sign bit of signed -# integers. Until #13538 is resolved, we can exempt the entire file from all -# analysis under clang's undefined behavior sanitizer. -# This may be overkill, but it works, and is easier than listing every -# function in the file. +# integers. Until #13538 is resolved, we exempt functions that do left shifts. # Note that x86_64 uses curve25519-donna-c64.c instead of curve25519-donna.c -src:src/ext/curve25519_donna/curve25519-donna.c +fun:freduce_coefficients +fun:freduce_degree +fun:s32_eq +fun:fcontract