From b72ad85502412236263b1764c197c4d3192ad16c Mon Sep 17 00:00:00 2001 From: Winlin Date: Tue, 22 Nov 2022 10:40:18 +0800 Subject: [PATCH] Asan: Check libasan and show tips. v5.0.92 (#3266) --- trunk/auto/depends.sh | 15 +++++++++++++++ trunk/doc/CHANGELOG.md | 1 + trunk/src/core/srs_core_version5.hpp | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index ee9e141d0..b9d953cdc 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -332,6 +332,21 @@ if [[ -d /usr/local/srs-cache/srs/trunk/objs && $(pwd) != "/usr/local/srs-cache/ fi fi +##################################################################################### +# Check for address sanitizer, see https://github.com/google/sanitizers +##################################################################################### +if [[ $SRS_SANITIZER == YES && $OS_IS_X86_64 == YES ]]; then + echo 'int main() { return 0; }' > ${SRS_OBJS}/test_sanitizer.cc && + gcc -fsanitize=address -fno-omit-frame-pointer -g -O0 ${SRS_OBJS}/test_sanitizer.cc \ + -o ${SRS_OBJS}/test_sanitizer 1>/dev/null 2>&1; + ret=$?; rm -f ${SRS_OBJS}/test_sanitizer ${SRS_OBJS}/test_sanitizer.cc + if [[ $ret -ne 0 ]]; then + echo "Please install libasan, see https://github.com/google/sanitizers"; + if [[ $OS_IS_CENTOS == YES ]]; then echo " sudo yum install -y libasan"; fi + exit $ret; + fi +fi + ##################################################################################### # state-threads ##################################################################################### diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 3523c51b6..e167cce27 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -8,6 +8,7 @@ The changelog for SRS. ## SRS 5.0 Changelog +* v5.0, 2022-11-22, Asan: Check libasan and show tips. v5.0.92 * v5.0, 2022-11-21, Merge [#3264](https://github.com/ossrs/srs/pull/3264): Asan: Try to fix st_memory_leak for asan check. (#3264). v5.0.91 * v5.0, 2022-11-21, Asan: Fix global ip address leak check. v5.0.90 * v5.0, 2022-11-20, For [#2532](https://github.com/ossrs/srs/issues/2532): Windows: Support cygwin pipline and packager. v5.0.89 diff --git a/trunk/src/core/srs_core_version5.hpp b/trunk/src/core/srs_core_version5.hpp index aaa88046c..63d68fa5a 100644 --- a/trunk/src/core/srs_core_version5.hpp +++ b/trunk/src/core/srs_core_version5.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 0 -#define VERSION_REVISION 91 +#define VERSION_REVISION 92 #endif