Skip to content

Commit

Permalink
Add AddressSanitizer
Browse files Browse the repository at this point in the history
Do not override the compilers (the CC and CXX environment variables).
For some reason, using CC=clang and CXX=clang++ (Clang 14.0.0) with
AddressSanitixer results in segmentation faults in the ubuntu-latest os
image.
  • Loading branch information
wantehchang committed Mar 20, 2024
1 parent edd02ee commit 14cb626
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/ci-unix-static-sanitized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
sanitizer: [ undefined ] # TODO(yguyon): Add address, memory, thread

env:
CC: clang
CXX: clang++
sanitizer: [ address, undefined ] # TODO(yguyon): Add memory, thread

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Clang (on Linux)
if: runner.os == 'Linux'
uses: egor-tensin/setup-clang@v1
with:
version: 14
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@959f1116cf9f1ae42fff8ec1a4aaae6d4a0e348b # v2.0.1
with:
Expand All @@ -31,13 +32,6 @@ jobs:
- uses: seanmiddleditch/gha-setup-ninja@8b297075da4cd2a5f1fd21fe011b499edf06e9d2 # v4
- run: pip install meson

- name: Cache external dependencies
id: cache-ext
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: ext
key: ${{ runner.os }}-${{ matrix.sanitizer }}-${{ hashFiles('ext/*.cmd') }}

- name: Build aom
if: steps.cache-ext.outputs.cache-hit != 'true'
working-directory: ./ext
Expand Down Expand Up @@ -91,5 +85,6 @@ jobs:
run: ninja
- name: Run AVIF Tests
working-directory: ./build
# ASAN_OPTIONS=allocator_may_return_null=1 may be necessary for address sanitizer.
run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure
env:
ASAN_OPTIONS: allocator_may_return_null=1

0 comments on commit 14cb626

Please sign in to comment.