From 4b1e73860fe7287a6cada04b786f4506c25ced38 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 30 Aug 2023 21:25:17 +0800 Subject: [PATCH] change asan leak --- tests/script/sh/checkAsan.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/script/sh/checkAsan.sh b/tests/script/sh/checkAsan.sh index 2784f301e3..efdb9e6b4a 100755 --- a/tests/script/sh/checkAsan.sh +++ b/tests/script/sh/checkAsan.sh @@ -30,13 +30,21 @@ fi TAOS_DIR=`pwd` LOG_DIR=$TAOS_DIR/sim/asan -error_num=`cat ${LOG_DIR}/*.asan | grep "ERROR" | wc -l` + + archOs=`arch` -if [[ $archOs =~ "aarch64" ]];then +if [[ $archOs =~ "aarch64" ]]; then echo "arm64 check mem leak" - memory_leak=`cat ${LOG_DIR}/*.asan | grep "Direct leak" | grep -v ""Direct leak of 32 byte"| wc -l` + memory_leak=`cat ${LOG_DIR}/*.asan | grep "Direct leak" | grep -v "Direct leak of 32 byte"| wc -l` + memory_count=`cat ${LOG_DIR}/*.asan | grep "Direct leak of 32 byte"| wc -l` + + if [ $memory_count == $error_num ] && [ $memory_leak == 0 ]; then + echo "reset error_num to 0, ignore: __cxa_thread_atexit_impl leak" + error_num=0 + fi else + echo "os check mem leak" memory_leak=`cat ${LOG_DIR}/*.asan | grep "Direct leak" | wc -l` fi