test/asan: move LSAN_OPTIONS to autotest_common.sh

Further patches in series will modify the suppression file,
so this patch now creates such file in /var/tmp/.
Meanwhile adding the known false positive to the list.

Any known false positives or leaks in external libs/execs
should be added by adding further entries to the suppression
file.

Change-Id: I7b78d900a86c6eca0b41240fb34dc4f7ad597079
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456622
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Tomasz Zawadzki 2019-06-03 08:32:57 -04:00 committed by Darek Stojaczyk
parent 37b5912545
commit 9fda9814b7
3 changed files with 14 additions and 6 deletions

View File

@ -1 +0,0 @@
leak:spdk_fs_alloc_thread_ctx

View File

@ -13,11 +13,6 @@ run_step() {
echo "--spdk_cache_size=$CACHE_SIZE" >> "$1"_flags.txt
echo -n Start $1 test phase...
# ASAN has some bugs around thread_local variables. We have a destructor in place
# to free the thread contexts, but ASAN complains about the leak before those
# destructors have a chance to run. So suppress this one specific leak using
# LSAN_OPTIONS.
export LSAN_OPTIONS="suppressions=$testdir/lsan_suppressions.txt"
/usr/bin/time taskset 0xFF $DB_BENCH --flagfile="$1"_flags.txt &> "$1"_db_bench.txt
DB_BENCH_FILE=$(grep /dev/shm "$1"_db_bench.txt | cut -f 6 -d ' ')
gzip $DB_BENCH_FILE

View File

@ -73,6 +73,19 @@ export PYTHONPATH=$PYTHONPATH:$rootdir/scripts
export ASAN_OPTIONS=new_delete_type_mismatch=0
export UBSAN_OPTIONS='halt_on_error=1:print_stacktrace=1:abort_on_error=1'
# Export LeakSanitizer option to use suppression file in order to prevent false positives
# and known leaks in external executables or libraries from showing up.
asan_suppression_file="/var/tmp/asan_suppression_file"
sudo rm -rf "$asan_suppression_file"
# ASAN has some bugs around thread_local variables. We have a destructor in place
# to free the thread contexts, but ASAN complains about the leak before those
# destructors have a chance to run. So suppress this one specific leak using
# LSAN_OPTIONS.
echo "leak:spdk_fs_alloc_thread_ctx" >> "$asan_suppression_file"
export LSAN_OPTIONS=suppressions="$asan_suppression_file"
export DEFAULT_RPC_ADDR="/var/tmp/spdk.sock"
if [ -z "$DEPENDENCY_DIR" ]; then
@ -808,6 +821,7 @@ function autotest_cleanup()
modprobe -r uio_pci_generic
fi
fi
rm -rf "$asan_suppression_file"
}
function freebsd_update_contigmem_mod()