Add tsan for fast interp and aot (#2679)
To run it locally: ```bash export TSAN_OPTIONS=suppressions=<path_to_tsan_suppressions.txt> ./test_wamr.sh <your flags> -T tsan ``` An example for wasi-threads would look like: ```bash export TSAN_OPTIONS=suppressions=<path_to_tsan_suppressions.txt> ./test_wamr.sh -w -s wasi_certification -t fast-interp -T tsan ```
This commit is contained in:
@ -32,6 +32,7 @@ function help()
|
||||
echo "-F set the firmware path used by qemu"
|
||||
echo "-C enable code coverage collect"
|
||||
echo "-j set the platform to test"
|
||||
echo "-T set sanitizer to use in tests(ubsan|tsan|asan)"
|
||||
}
|
||||
|
||||
OPT_PARSED=""
|
||||
@ -59,7 +60,7 @@ QEMU_FIRMWARE=""
|
||||
# prod/testsuite-all branch
|
||||
WASI_TESTSUITE_COMMIT="ee807fc551978490bf1c277059aabfa1e589a6c2"
|
||||
|
||||
while getopts ":s:cabgvt:m:MCpSXxwPGQF:j:" opt
|
||||
while getopts ":s:cabgvt:m:MCpSXxwPGQF:j:T:" opt
|
||||
do
|
||||
OPT_PARSED="TRUE"
|
||||
case $opt in
|
||||
@ -165,9 +166,14 @@ do
|
||||
echo "test platform " ${OPTARG}
|
||||
PLATFORM=${OPTARG}
|
||||
;;
|
||||
T)
|
||||
echo "sanitizer is " ${OPTARG}
|
||||
WAMR_BUILD_SANITIZER=${OPTARG}
|
||||
;;
|
||||
?)
|
||||
help
|
||||
exit 1;;
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@ -553,7 +559,7 @@ function wasi_certification_test()
|
||||
cd wasi-testsuite
|
||||
git reset --hard ${WASI_TESTSUITE_COMMIT}
|
||||
|
||||
bash ../../wasi-test-script/run_wasi_tests.sh $1 $TARGET \
|
||||
TSAN_OPTIONS=${TSAN_OPTIONS} bash ../../wasi-test-script/run_wasi_tests.sh $1 $TARGET \
|
||||
| tee -a ${REPORT_DIR}/wasi_test_report.txt
|
||||
ret=${PIPESTATUS[0]}
|
||||
|
||||
|
||||
11
tests/wamr-test-suites/tsan_suppressions.txt
Normal file
11
tests/wamr-test-suites/tsan_suppressions.txt
Normal file
@ -0,0 +1,11 @@
|
||||
# Proposing to accept this risk for now. It might be wasi-libc related.
|
||||
# https://github.com/bytecodealliance/wasm-micro-runtime/pull/1963#issuecomment-1455342931
|
||||
race:STORE_U32
|
||||
|
||||
|
||||
# https://github.com/bytecodealliance/wasm-micro-runtime/issues/2680
|
||||
race:execute_post_instantiate_functions
|
||||
|
||||
# Suppressing signal-unsafe inside of a signal for AOT mode
|
||||
# see https://github.com/bytecodealliance/wasm-micro-runtime/issues/2248#issuecomment-1630189656
|
||||
signal:*
|
||||
@ -67,7 +67,7 @@ if [[ $MODE != "aot" ]];then
|
||||
python3 -m pip install -r test-runner/requirements.txt
|
||||
|
||||
export TEST_RUNTIME_EXE="${IWASM_CMD}"
|
||||
python3 ${THIS_DIR}/pipe.py | python3 test-runner/wasi_test_runner.py \
|
||||
python3 ${THIS_DIR}/pipe.py | TSAN_OPTIONS=${TSAN_OPTIONS} python3 test-runner/wasi_test_runner.py \
|
||||
-r adapters/wasm-micro-runtime.py \
|
||||
-t \
|
||||
${C_TESTS} \
|
||||
@ -79,7 +79,7 @@ if [[ $MODE != "aot" ]];then
|
||||
|
||||
ret=${PIPESTATUS[1]}
|
||||
|
||||
TEST_RUNTIME_EXE="${IWASM_CMD_STRESS}" python3 test-runner/wasi_test_runner.py \
|
||||
TEST_RUNTIME_EXE="${IWASM_CMD_STRESS}" TSAN_OPTIONS=${TSAN_OPTIONS} python3 test-runner/wasi_test_runner.py \
|
||||
-r adapters/wasm-micro-runtime.py \
|
||||
-t \
|
||||
${THREAD_STRESS_TESTS}
|
||||
|
||||
Reference in New Issue
Block a user