Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 38 additions & 8 deletions .github/workflows/asan.yml → .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: address sanitizer
name: sanitizers

on:
push:
Expand All @@ -18,12 +18,35 @@ permissions:
jobs:
build:

strategy:
matrix:
include:
- sanitizer: 'asan'
cmake_opts: '-DANALYZE_ADDRESS=On'
run_ctest: true
inject_executor: 'process'
run_selfcheck: false # TODO: this is currently way too slow (~60 minutes) to enable it
- sanitizer: 'tsan'
cmake_opts: '-DANALYZE_THREAD=On'
run_ctest: false # TODO: test-filelist fails with data race in pthread_cond_destroy
inject_executor: 'thread'
run_selfcheck: false # TODO: disabled for now as it takes around 40 minutes to finish
selfcheck_opts: '--executor=thread --error-exitcode=0' # set --error-exitcode=0 so we only fail on sanitizer issues - since it uses threads for execution it will exit the whole process on the first issue
- sanitizer: 'ubsan'
cmake_opts: '-DANALYZE_UNDEFINED=On'
run_ctest: true
inject_executor: 'process'
run_selfcheck: true
fail-fast: false

runs-on: ubuntu-22.04

env:
QT_VERSION: 6.10.0
ASAN_OPTIONS: detect_stack_use_after_return=1
LSAN_OPTIONS: suppressions=lsan-suppr.txt:print_suppressions=0
TSAN_OPTIONS: halt_on_error=1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1:report_error_type=1
# TODO: figure out why there are cache misses with PCH enabled
CCACHE_SLOPPINESS: pch_defines,time_macros

Expand All @@ -35,7 +58,7 @@ jobs:
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}-${{ matrix.sanitizer }}

- name: Set up Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -74,7 +97,7 @@ jobs:
- name: CMake
run: |
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_ADDRESS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify ${{ matrix.cmake_opts }} -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
env:
CC: clang-22
CXX: clang++-22
Expand All @@ -98,7 +121,13 @@ jobs:
run: |
cmake --build cmake.output --target checkcfg -- -j $(nproc)
- name: Copy LSAN suppressions
if: matrix.sanitizer == 'asan'
run: |
cp lsan-suppr.txt cmake.output/bin
- name: Run CTest
if: matrix.run_ctest
run: |
cp lsan-suppr.txt cmake.output/bin
ctest --test-dir cmake.output --output-on-failure -j$(nproc)
Expand All @@ -107,6 +136,8 @@ jobs:
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
env:
TEST_CPPCHECK_INJECT_EXECUTOR: thread

- name: Run test/cli (-j2)
run: |
Expand All @@ -128,18 +159,17 @@ jobs:
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
env:
TEST_CPPCHECK_INJECT_BUILDDIR: injected
TEST_CPPCHECK_INJECT_BUILDDIR: ${{ matrix.inject_executor }}

- name: Generate dependencies
if: false
if: matrix.run_selfcheck
run: |
# make sure auto-generated GUI files exist
make -C cmake.output autogen
make -C cmake.output gui-build-deps triage-build-ui-deps
# TODO: this is currently way too slow (~60 minutes) to enable it
# TODO: only fail the step on sanitizer issues - since we use processes it will only fail the underlying process which will result in an cppcheckError
- name: Self check
if: false
if: matrix.run_selfcheck
run: |
./selfcheck_san.sh ./cmake.output
./selfcheck_san.sh ./cmake.output ${{ matrix.selfcheck_opts }}
146 changes: 0 additions & 146 deletions .github/workflows/tsan.yml

This file was deleted.

140 changes: 0 additions & 140 deletions .github/workflows/ubsan.yml

This file was deleted.

Loading