Commit 9fda9814 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki Committed by Darek Stojaczyk
Browse files

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: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456622


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 37b59125
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
leak:spdk_fs_alloc_thread_ctx
+0 −5
Original line number Diff line number Diff line
@@ -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
+14 −0
Original line number Diff line number Diff line
@@ -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()