]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
ci: enable sanitizers in the meson build
authorEmil Velikov <emil.l.velikov@gmail.com>
Sat, 28 Sep 2024 13:12:26 +0000 (14:12 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 1 Oct 2024 13:52:13 +0000 (08:52 -0500)
... to prevent a range of issues creeping in.

Currently ASAN reports an ordering issue that we need to explicitly
disable. Thus the sanitizers are only enabled in CI and not for all
developer builds (aka build-dev.ini).

Seemingly musl lacks the sanitizers, so we don't enable it on Alpine.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/160
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
.github/actions/setup-fedora/action.yml
.github/workflows/main.yml

index 946d0fc32b0d24f31a1b8ac244547f34e7e777f3..0e31a58ba4207de87bfbe318ab8a7dde2ee61105 100644 (file)
@@ -25,6 +25,11 @@ runs:
           openssl-devel \
           git \
           gtk-doc \
+          libasan \
+          libhwasan \
+          liblsan \
+          libtsan \
+          libubsan \
           libtool \
           rsync \
           scdoc
index 56080a4d6b3d4971c7d2b41993b5a0ec285444bf..8cfae7544c7bbbe01e00848000f4337d1235989b 100644 (file)
@@ -25,15 +25,20 @@ jobs:
         build: ['meson', 'autotools']
         container:
           - name: 'ubuntu:22.04'
+            meson_setup: '-D b_sanitize=address,undefined'
             multilib: 'true'
           - name: 'ubuntu:24.04'
+            meson_setup: '-D b_sanitize=address,undefined'
             multilib: 'true'
           - name: 'archlinux:base-devel'
+            meson_setup: '-D b_sanitize=address,undefined'
             multilib: 'true'
           - name: 'fedora:latest'
+            meson_setup: '-D b_sanitize=address,undefined'
           - name: 'alpine:latest'
             meson_setup: '-D docs=false'
           - name: 'debian:unstable'
+            meson_setup: '-D b_sanitize=address,undefined'
             multilib: 'true'
 
     container:
@@ -66,6 +71,7 @@ jobs:
           git config --global --add safe.directory '*'
 
           .github/print-kdir.sh >> "$GITHUB_ENV"
+          echo "ASAN_OPTIONS=verify_asan_link_order=0:halt_on_error=1:abort_on_error=1:print_summary=1" >> "$GITHUB_ENV"
 
       - name: configure (meson)
         if: ${{ matrix.build == 'meson' }}