From 2ed576748ab28a486c830913811125144522d368 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 30 Aug 2023 18:18:21 +0800 Subject: [PATCH 1/3] fix merge error --- tests/script/sh/checkAsan.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/script/sh/checkAsan.sh b/tests/script/sh/checkAsan.sh index 0077ca4e0e..2784f301e3 100755 --- a/tests/script/sh/checkAsan.sh +++ b/tests/script/sh/checkAsan.sh @@ -31,7 +31,16 @@ TAOS_DIR=`pwd` LOG_DIR=$TAOS_DIR/sim/asan error_num=`cat ${LOG_DIR}/*.asan | grep "ERROR" | wc -l` -memory_leak=`cat ${LOG_DIR}/*.asan | grep "Direct leak" | wc -l` + +archOs=`arch` +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` +else + memory_leak=`cat ${LOG_DIR}/*.asan | grep "Direct leak" | wc -l` +fi + + indirect_leak=`cat ${LOG_DIR}/*.asan | grep "Indirect leak" | wc -l` python_error=`cat ${LOG_DIR}/*.info | grep -w "stack" | wc -l` From 4b1e73860fe7287a6cada04b786f4506c25ced38 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 30 Aug 2023 21:25:17 +0800 Subject: [PATCH 2/3] 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 From 4372ebdab5c98f4be05b9c1b4ef6b5e53e109940 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 30 Aug 2023 21:48:16 +0800 Subject: [PATCH 3/3] change asan leak --- tests/script/sh/checkAsan.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/script/sh/checkAsan.sh b/tests/script/sh/checkAsan.sh index efdb9e6b4a..19057d8834 100755 --- a/tests/script/sh/checkAsan.sh +++ b/tests/script/sh/checkAsan.sh @@ -32,6 +32,7 @@ LOG_DIR=$TAOS_DIR/sim/asan +error_num=`cat ${LOG_DIR}/*.asan | grep "ERROR" | wc -l` archOs=`arch` if [[ $archOs =~ "aarch64" ]]; then @@ -39,7 +40,7 @@ if [[ $archOs =~ "aarch64" ]]; then 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 + if [ $memory_count -eq $error_num ] && [ $memory_leak -eq 0 ]; then echo "reset error_num to 0, ignore: __cxa_thread_atexit_impl leak" error_num=0 fi