diff --git a/.circleci/config.yml b/.circleci/config.yml index 31acc1695..c7ce12456 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,56 +59,6 @@ jobs: - run: meson compile -Cbuild -j9 - run: RUN_VALGRIND=1 meson test -Cbuild -t 10 --no-suite=slow --wrap='valgrind --leak-check=full --error-exitcode=1' --print-errorlogs --num-processes=$(($(nproc)/2 + 1)) - asan-ubsan: - docker: - - image: ubuntu - steps: - - checkout - - run: apt update || true - - run: DEBIAN_FRONTEND=noninteractive apt install -y python3 python3-pip python3-venv ninja-build clang lld git binutils pkg-config ragel libfreetype6-dev libglib2.0-dev libcairo2-dev libicu-dev libgraphite2-dev - - run: | - export ASAN_OPTIONS=log_path=stderr:halt_on_error=1:abort_on_error=1 - export UBSAN_OPTIONS=log_path=stderr:halt_on_error=1:abort_on_error=1:print_stacktrace=1 - python3 -m venv venv - source venv/bin/activate - pip3 install meson==0.60.0 - CC=clang CXX=clang++ meson setup build --default-library=static -Db_sanitize=address,undefined --buildtype=debugoptimized --wrap-mode=nodownload -Dexperimental_api=true - meson compile -Cbuild -j9 - meson test -Cbuild -t 10 --print-errorlogs | asan_symbolize | c++filt - - tsan: - docker: - - image: ubuntu:24.04 - steps: - - checkout - - run: apt update || true - - run: DEBIAN_FRONTEND=noninteractive apt install -y python3 python3-pip python3-venv ninja-build clang lld git binutils pkg-config ragel libfreetype6-dev libglib2.0-dev libcairo2-dev libicu-dev libgraphite2-dev - - run: | - export TSAN_OPTIONS=log_path=stderr:halt_on_error=1:abort_on_error=1 - python3 -m venv venv - source venv/bin/activate - pip3 install meson==0.60.0 - CC=clang CXX=clang++ meson setup build --default-library=static -Db_sanitize=thread --buildtype=debugoptimized --wrap-mode=nodownload -Dexperimental_api=true - meson compile -Cbuild -j9 - meson test -Cbuild -t 10 --print-errorlogs | asan_symbolize | c++filt - - msan: - docker: - - image: ubuntu:24.04 - steps: - - checkout - - run: apt update || true - - run: DEBIAN_FRONTEND=noninteractive apt install -y python3 python3-pip python3-venv ninja-build clang lld git binutils pkg-config ragel libfreetype6-dev libglib2.0-dev libcairo2-dev libicu-dev libgraphite2-dev - - run: | - export MSAN_OPTIONS=log_path=stderr:halt_on_error=1:abort_on_error=1:print_stacktrace=1 - python3 -m venv venv - source venv/bin/activate - pip3 install meson==0.60.0 - # msan, needs --force-fallback-for=glib,freetype2 also which doesn't work yet but runs fuzzer cases at least - CC=clang CXX=clang++ meson setup build --default-library=static -Db_sanitize=memory --buildtype=debugoptimized --wrap-mode=nodownload -Dauto_features=disabled -Dtests=enabled -Dexperimental_api=true - meson compile -Cbuild -j9 - meson test -Cbuild -t 10 --print-errorlogs | asan_symbolize | c++filt - clang-cxx2a: docker: - image: ubuntu @@ -202,9 +152,6 @@ workflows: branches: ignore: /.*/ - fedora-valgrind - - asan-ubsan - - tsan - - msan - clang-cxx2a - crossbuild-win32: filters: # must have filter or won't work as a dependency diff --git a/.github/workflows/sanitizers-ci.yml b/.github/workflows/sanitizers-ci.yml new file mode 100644 index 000000000..c79e92ec8 --- /dev/null +++ b/.github/workflows/sanitizers-ci.yml @@ -0,0 +1,70 @@ +name: sanitizers + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-24.04 + name: ${{ matrix.name }} + env: + CC: clang + CXX: clang++ + ASAN_OPTIONS: log_path=stderr:halt_on_error=1:abort_on_error=1 + UBSAN_OPTIONS: log_path=stderr:halt_on_error=1:abort_on_error=1:print_stacktrace=1 + TSAN_OPTIONS: log_path=stderr:halt_on_error=1:abort_on_error=1 + MSAN_OPTIONS: log_path=stderr:halt_on_error=1:abort_on_error=1:print_stacktrace=1 + strategy: + fail-fast: false + matrix: + include: + - name: asan-ubsan + SANITIZE: address,undefined + - name: tsan + SANITIZE: thread + - name: msan + SANITIZE: memory + + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Setup Ccache + uses: hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 # v1.2.18 + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt install -y \ + clang \ + lld \ + binutils \ + pkg-config \ + libfreetype6-dev \ + libglib2.0-dev \ + libcairo2-dev \ + libicu-dev \ + libgraphite2-dev + - name: Setup Python + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + with: + python-version: '3.12' + - name: Install Python Dependencies + run: pip3 install -r .ci/requirements.txt --require-hashes + - name: Setup Meson + run: | + ccache --version + meson setup build \ + --default-library=static \ + --buildtype=debugoptimized \ + --wrap-mode=nodownload \ + -Db_sanitize=${{ matrix.SANITIZE }} \ + -Dexperimental_api=true + - name: Build + run: meson compile -Cbuild + - name: Test + run: meson test -Cbuild -t 10 --print-errorlogs | asan_symbolize | c++filt