Skip to content

Commit de4157f

Browse files
ci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs
1 parent bf0ac46 commit de4157f

File tree

2 files changed

+48
-21
lines changed

2 files changed

+48
-21
lines changed

.cirrus.yml

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,27 +63,8 @@ task:
6363
- env: {BUILD: distcheck, WITH_VALGRIND: no, CTIMETEST: no, BENCH: no}
6464
- env: {CPPFLAGS: -DDETERMINISTIC}
6565
- env: {CFLAGS: -O0, CTIMETEST: no}
66-
- env:
67-
CFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
68-
LDFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
69-
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
70-
ASM: x86_64
71-
ECDH: yes
72-
RECOVERY: yes
73-
EXPERIMENTAL: yes
74-
SCHNORRSIG: yes
75-
CTIMETEST: no
7666
- env: { ECMULTGENPRECISION: 2 }
7767
- env: { ECMULTGENPRECISION: 8 }
78-
- env:
79-
RUN_VALGRIND: yes
80-
ASM: x86_64
81-
ECDH: yes
82-
RECOVERY: yes
83-
EXPERIMENTAL: yes
84-
SCHNORRSIG: yes
85-
EXTRAFLAGS: "--disable-openssl-tests"
86-
BUILD:
8768
matrix:
8869
- env:
8970
CC: gcc
@@ -262,3 +243,48 @@ task:
262243
test_script:
263244
- ./ci/cirrus.sh
264245
<< : *CAT_LOGS
246+
247+
# Sanitizers
248+
task:
249+
container:
250+
dockerfile: ci/linux-debian.Dockerfile
251+
cpu: 1
252+
memory: 1G
253+
env:
254+
ECDH: yes
255+
RECOVERY: yes
256+
EXPERIMENTAL: yes
257+
SCHNORRSIG: yes
258+
CTIMETEST: no
259+
EXTRAFLAGS: "--disable-openssl-tests"
260+
matrix:
261+
- name: "Valgrind (memcheck)"
262+
env:
263+
RUN_VALGRIND: yes
264+
- name: "UBSan, ASan, LSan"
265+
env:
266+
CFLAGS: "-fsanitize=undefined,address"
267+
CFLAGS_FOR_BUILD: "-fsanitize=undefined,address"
268+
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
269+
ASAN_OPTIONS: "strict_string_checks=1:detect_stack_use_after_return=1:detect_leaks=1"
270+
LSAN_OPTIONS: "use_unaligned=1"
271+
# Try to cover many configurations with just a tiny matrix.
272+
matrix:
273+
- env:
274+
ASM: auto
275+
STATICPRECOMPUTATION: yes
276+
- env:
277+
ASM: no
278+
STATICPRECOMPUTATION: no
279+
ECMULTGENPRECISION: 2
280+
matrix:
281+
- env:
282+
CC: clang
283+
- env:
284+
HOST: i686-linux-gnu
285+
CC: i686-linux-gnu-gcc
286+
<< : *MERGE_BASE
287+
test_script:
288+
- ./ci/cirrus.sh
289+
<< : *CAT_LOGS
290+

ci/linux-debian.Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ RUN dpkg --add-architecture arm64
77
RUN apt-get update
88

99
# dkpg-dev: to make pkg-config work in cross-builds
10+
# llvm: for llvm-symbolizer, which is used by clang's UBSan for symbolized stack traces
1011
RUN apt-get install --no-install-recommends --no-upgrade -y \
1112
git ca-certificates \
1213
make automake libtool pkg-config dpkg-dev valgrind qemu-user \
13-
gcc clang libc6-dbg \
14-
gcc-i686-linux-gnu libc6-dev-i386-cross libc6-dbg:i386 \
14+
gcc clang llvm libc6-dbg \
15+
gcc-i686-linux-gnu libc6-dev-i386-cross libc6-dbg:i386 libubsan1:i386 libasan5:i386 \
1516
gcc-s390x-linux-gnu libc6-dev-s390x-cross libc6-dbg:s390x \
1617
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross libc6-dbg:armhf \
1718
gcc-aarch64-linux-gnu libc6-dev-arm64-cross libc6-dbg:arm64 \

0 commit comments

Comments
 (0)