From fba0c7908026a519086a460fcd26dd47557c305f Mon Sep 17 00:00:00 2001 From: James Bonfield Date: Thu, 18 Jul 2024 14:59:31 +0100 Subject: [PATCH] Add ubsan to the asan CI check. We already have address sanitizer, so add "undefined" into the mix. --- .cirrus.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 5d2e3b6a73..2cb4722e52 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -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 + LDFLAGS: -fsanitize=address,undefined USE_LIBDEFLATE: yes + UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1 install_script: | apt-get update @@ -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