]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Added sanitizer tests in configure GitHub Actions workflow.
authorNathan Moinvaziri <nathan@nathanm.com>
Thu, 17 Mar 2022 19:22:22 +0000 (12:22 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 21 Mar 2022 10:33:08 +0000 (11:33 +0100)
Added missing OPTIONS environment variable for UBSAN in CMake GitHub workflow.

.github/workflows/cmake.yml
.github/workflows/configure.yml

index 13c1933f10f3f8fa28db5e854ff2da99a3ba43b7..2bf834a70f7522f34f178791e5c662ea2f86f5b9 100644 (file)
@@ -41,21 +41,20 @@ jobs:
             cmake-args: -DZLIB_COMPAT=ON -DZLIB_SYMBOL_PREFIX=zTest_
             codecov: ubuntu_gcc_compat_sprefix
 
-          - name: Ubuntu GCC OSB -O1 UBSAN
+          - name: Ubuntu GCC -O1 OSB
             os: ubuntu-latest
             compiler: gcc
             cxx-compiler: g++
-            cmake-args: -DWITH_SANITIZER=Undefined
             build-dir: ../build
             build-src-dir: ../zlib-ng
             codecov: ubuntu_gcc_osb
             cflags: -O1 -g3
 
-          - name: Ubuntu GCC -O3 No Unaligned
+          - name: Ubuntu GCC -O3 No Unaligned UBSAN
             os: ubuntu-latest
             compiler: gcc
             cxx-compiler: g++
-            cmake-args: -DWITH_UNALIGNED=OFF
+            cmake-args: -DWITH_UNALIGNED=OFF -DWITH_SANITIZER=Undefined
             codecov: ubuntu_gcc_o3
             cflags: -O3
 
@@ -493,6 +492,7 @@ jobs:
         MSAN_OPTIONS: ${{ matrix.msan-options || 'verbosity=0' }}:abort_on_error=1
         TSAN_OPTIONS: ${{ matrix.tsan-options || 'verbosity=0' }}:abort_on_error=1
         LSAN_OPTIONS: ${{ matrix.lsan-options || 'verbosity=0' }}:abort_on_error=1
+        UBSAN_OPTIONS: ${{ matrix.ubsan-options || 'verbosity=0' }}:print_stacktrace=1:abort_on_error=1
 
     - name: Generate coverage report
       if: matrix.codecov
index 2c72afb8aaac0e0f9f1a605e32401d8cb8ae8901..2ab9d0e5242ec2ff929cf3a015fb382b1bad1ec4 100644 (file)
@@ -30,6 +30,21 @@ jobs:
             compiler: gcc
             configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies
 
+          - name: Ubuntu GCC ASAN
+            os: ubuntu-latest
+            compiler: gcc
+            configure-args: --warn --with-sanitizer=address
+
+          - name: Ubuntu GCC MSAN
+            os: ubuntu-latest
+            compiler: gcc
+            configure-args: --warn --with-sanitizer=memory
+
+          - name: Ubuntu GCC No Unaligned UBSAN
+            os: ubuntu-latest
+            compiler: gcc
+            configure-args: --warn --without-unaligned --with-sanitizer=undefined
+
           - name: Ubuntu GCC ARM SF
             os: ubuntu-latest
             compiler: arm-linux-gnueabi-gcc
@@ -224,6 +239,9 @@ jobs:
         make test
       env:
         QEMU_RUN: ${{ matrix.qemu-run }}
+        ASAN_OPTIONS: abort_on_error=1
+        MSAN_OPTIONS: abort_on_error=1
+        UBSAN_OPTIONS: print_stacktrace=1:abort_on_error=1
 
     - name: Upload build errors
       uses: actions/upload-artifact@v2