Skip to content

Commit

Permalink
Add ubsan to the asan CI check.
Browse files Browse the repository at this point in the history
We already have address sanitizer, so add "undefined" into the mix.

We also have to tweak a few warnings when using ubsan.
  • Loading branch information
jkbonfield committed Aug 6, 2024
1 parent f1a7ec9 commit a748440
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ gcc_task:
USE_CONFIG: no
- environment:
USE_CONFIG: yes
CFLAGS: -std=c99 -pedantic -Wformat=2 -fsanitize=address
LDFLAGS: -fsanitize=address
# ubsan is incompatible with some -Wformat opts so we do that on clang.
CFLAGS: -fsanitize=address,undefined -DHTS_ALLOW_UNALIGNED=0 -Wno-format-truncation -Wno-format-overflow
LDFLAGS: -fsanitize=address,undefined
USE_LIBDEFLATE: yes
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1

install_script: |
apt-get update
Expand Down Expand Up @@ -108,8 +110,9 @@ ubuntu_task:
USE_CONFIG: yes
DO_UNTRACKED_FILE_CHECK: yes
- environment:
# Cirrus-CI's clang isn't installed with ubsan, so we do that in gcc
USE_CONFIG: yes
CFLAGS: -g -Wall -O3
CFLAGS: -std=c99 -pedantic -Wformat -g -Wall -O3
USE_LIBDEFLATE: yes

# NB: we could consider building a docker image with these
Expand Down

0 comments on commit a748440

Please sign in to comment.