Skip to content

Commit 3a084ca

Browse files
committed
CI: enable sanitizers in Ubuntu Focal jobs
1 parent c92e872 commit 3a084ca

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,22 @@ jobs:
3030
libboost-filesystem-dev libboost-program-options-dev \
3131
libboost-python-dev libboost-regex-dev
3232
33+
- name: '[Focal] Add sanitizers to CXXFLAGS'
34+
if: matrix.version >= 20.04
35+
run: |
36+
# Use ASAN and UBSAN
37+
CXXFLAGS="-fsanitize=address,undefined"
38+
# Recommended for better error traces
39+
CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer"
40+
# Make UBSAN reports fatal
41+
CXXFLAGS="$CXXFLAGS -fno-sanitize-recover=all"
42+
43+
# Make UBSAN print whole stack traces
44+
UBSAN_OPTIONS="print_stacktrace=1"
45+
46+
# Store the env variables
47+
echo "CXXFLAGS=$CXXFLAGS" >> "$GITHUB_ENV"
48+
echo "UBSAN_OPTIONS=$UBSAN_OPTIONS" >> "$GITHUB_ENV"
49+
3350
- name: Build and check
3451
run: make distcheck

0 commit comments

Comments
 (0)