From 18f3a22b20c690b80b8bae923aac212625d390fe Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Mon, 16 Apr 2018 17:34:01 -0700 Subject: [PATCH] test: disable ASLR for multi-process tests Multi-process tests should work fine using the DPDK -base-virtaddr parameter. But we run tests with ASAN enabled and ASAN instrumentation results in mmap address hints getting ignored. Signed-off-by: Jim Harris Change-Id: I089d31726c7b8f5ed0ccdc2deb19acc5431260f1 Reviewed-on: https://review.gerrithub.io/407843 Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp Reviewed-by: Ben Walker --- test/common/autotest_common.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 2eb6b69fd..0fe53b73c 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -333,6 +333,11 @@ function rbd_cleanup() { } function start_stub() { + # Disable ASLR for multi-process testing. SPDK does support using DPDK multi-process, + # but ASAN instrumentation will result in mmap hints in our specified virt address + # region getting ignored. We will reenable it again after multi-process testing + # is complete in kill_stub() + echo 0 > /proc/sys/kernel/randomize_va_space $rootdir/test/app/stub/stub $1 & stubpid=$! echo Waiting for stub to ready for secondary processes... @@ -348,6 +353,10 @@ function kill_stub() { kill $stubpid wait $stubpid rm -f /var/run/spdk_stub0 + # Re-enable ASLR now that we are done with multi-process testing + # Note: "1" enables ASLR w/o randomizing data segments, "2" adds data segment + # randomizing and is the default on all recent Linux kernels + echo 2 > /proc/sys/kernel/randomize_va_space } function run_test() {