diff --git a/.github/workflows/code_sanitizers.yml b/.github/workflows/code_sanitizers.yml index 5e555633..d98587aa 100644 --- a/.github/workflows/code_sanitizers.yml +++ b/.github/workflows/code_sanitizers.yml @@ -4,19 +4,24 @@ on: [push, pull_request, workflow_dispatch] jobs: linux_sanitizers: - name: Linux [${{ matrix.SANITIZER }}] [${{ matrix.BACKEND }} | ${{ matrix.COMPILER }}] + name: Linux [${{ matrix.SANITIZER.name }}] [${{ matrix.BACKEND }} | ${{ matrix.COMPILER }}] ${{ matrix.SANITIZER.ignore_errors && ' (Errors Ignored)' || '' }} timeout-minutes: 120 strategy: fail-fast: false matrix: BACKEND: [lmdb, rocksdb] COMPILER: [clang] - SANITIZER: [ASAN, ASAN_INT, TSAN] + SANITIZER: + - { name: UBSAN, ignore_errors: false } + - { name: ASAN, ignore_errors: true } + - { name: ASAN_INT, ignore_errors: true } + - { name: TSAN, ignore_errors: true } runs-on: ubuntu-22.04 env: COMPILER: ${{ matrix.COMPILER }} BACKEND: ${{ matrix.BACKEND }} - SANITIZER: ${{ matrix.SANITIZER }} + SANITIZER: ${{ matrix.SANITIZER.name }} + IGNORE_ERRORS: ${{ matrix.SANITIZER.ignore_errors }} TEST_USE_ROCKSDB: ${{ matrix.BACKEND == 'rocksdb' && '1' || '0' }} DEADLINE_SCALE_FACTOR: ${{ matrix.BACKEND == 'rocksdb' && '2' || '1' }} ASAN_OPTIONS: log_exe_name=1:log_path=sanitizer_report:suppressions=../asan_suppressions @@ -50,6 +55,6 @@ jobs: - name: Reports if: steps.build.outcome == 'success' && (success() || failure()) - continue-on-error: true + continue-on-error: ${{ env.IGNORE_ERRORS == 'true' }} run: ../ci/tests/show-sanitizer-reports.sh working-directory: build diff --git a/ci/build.sh b/ci/build.sh index 62192e7e..7c25a724 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -1,5 +1,6 @@ #!/bin/bash set -euox pipefail +shopt -s nocasematch # Enable case-insensitive matching BUILD_TARGET="" if [[ ${1:-} ]]; then @@ -35,6 +36,9 @@ if [[ ${SANITIZER:-} ]]; then TSAN) CMAKE_SANITIZER="-DNANO_TSAN=ON" ;; + UBSAN) + CMAKE_SANITIZER="-DNANO_UBSAN=ON" + ;; *) echo "Unknown sanitizer: '${SANITIZER}'" exit 1