From b6fc2f1a687391ea5e04ca0af70ff8acb9a8c904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Sat, 20 Feb 2021 13:34:57 +0100 Subject: [PATCH] added self-check to sanitizer builds (#3017) --- .github/workflows/asan.yml | 8 +++++++- .github/workflows/ubsan.yml | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml index 5ab7dda42..52fdaa0d3 100644 --- a/.github/workflows/asan.yml +++ b/.github/workflows/asan.yml @@ -19,12 +19,18 @@ jobs: - name: Build run: | - CC=clang CXX=clang++ CXXFLAGS="-fsanitize=address -O1 -g3 -DCPPCHK_GLIBCXX_DEBUG" make cppcheck testrunner -j$(nproc) USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes + CC=clang CXX=clang++ CXXFLAGS="-fsanitize=address -O1 -g3 -DCPPCHK_GLIBCXX_DEBUG" CPPFLAGS="-DCHECK_INTERNAL" make cppcheck testrunner -j$(nproc) USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes VERIFY=1 - name: Run tests run: | ASAN_OPTIONS=detect_stack_use_after_return=1 ./testrunner + - name: Self check + run: | + ASAN_OPTIONS=detect_stack_use_after_return=1 ./cppcheck -q -j$(nproc) --template=selfcheck -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli --inconclusive --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings cli lib + ASAN_OPTIONS=detect_stack_use_after_return=1 ./cppcheck -q -j$(nproc) --template=selfcheck -D__CPPCHECK__ -DQT_VERSION=0x050000 --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=qt -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings gui/*.cpp + ASAN_OPTIONS=detect_stack_use_after_return=1 ./cppcheck -q -j$(nproc) --template=selfcheck -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli -Igui --inconclusive --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings test/*.cpp tools + # This takes too long time right now # - name: Bughunting lib # run: | diff --git a/.github/workflows/ubsan.yml b/.github/workflows/ubsan.yml index 4cf41e788..dae34f947 100644 --- a/.github/workflows/ubsan.yml +++ b/.github/workflows/ubsan.yml @@ -19,12 +19,18 @@ jobs: - name: Build run: | - CC=clang CXX=clang++ CXXFLAGS="-fsanitize=undefined -fsanitize=nullability -O1 -g3 -DCPPCHK_GLIBCXX_DEBUG" make cppcheck testrunner -j$(nproc) USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes + CC=clang CXX=clang++ CXXFLAGS="-fsanitize=undefined -fsanitize=nullability -fno-sanitize=signed-integer-overflow -O1 -g3 -DCPPCHK_GLIBCXX_DEBUG" CPPFLAGS="-DCHECK_INTERNAL" make cppcheck testrunner -j$(nproc) USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes VERIFY=1 - name: Run tests run: | UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./testrunner + - name: Self check + run: | + UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./cppcheck -q -j$(nproc) --template=selfcheck -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli --inconclusive --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings cli lib + UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./cppcheck -q -j$(nproc) --template=selfcheck -D__CPPCHECK__ -DQT_VERSION=0x050000 --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=qt -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings gui/*.cpp + UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./cppcheck -q -j$(nproc) --template=selfcheck -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli -Igui --inconclusive --enable=style,performance,portability,warning,internal --exception-handling --debug-warnings test/*.cpp tools + # This takes too long time right now # - name: Bughunting lib # run: |