Skip to content

Commit ffdda1e

Browse files
jkbonfielddaviesrob
authored andcommitted
Add ubsan to the asan CI check.
We already have address sanitizer, so add "undefined" into the mix. We also have to tweak a few warnings when using ubsan.
1 parent b14639f commit ffdda1e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.cirrus.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ gcc_task:
7373
USE_CONFIG: no
7474
- environment:
7575
USE_CONFIG: yes
76-
CFLAGS: -std=c99 -pedantic -Wformat=2 -fsanitize=address
77-
LDFLAGS: -fsanitize=address
76+
# ubsan is incompatible with some -Wformat opts so we do that on clang.
77+
CFLAGS: -fsanitize=address,undefined -DHTS_ALLOW_UNALIGNED=0 -Wno-format-truncation -Wno-format-overflow
78+
LDFLAGS: -fsanitize=address,undefined
7879
USE_LIBDEFLATE: yes
80+
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
7981

8082
install_script: |
8183
apt-get update
@@ -108,8 +110,9 @@ ubuntu_task:
108110
USE_CONFIG: yes
109111
DO_UNTRACKED_FILE_CHECK: yes
110112
- environment:
113+
# Cirrus-CI's clang isn't installed with ubsan, so we do that in gcc
111114
USE_CONFIG: yes
112-
CFLAGS: -g -Wall -O3
115+
CFLAGS: -std=c99 -pedantic -Wformat -g -Wall -O3
113116
USE_LIBDEFLATE: yes
114117

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

0 commit comments

Comments
 (0)