]> git.kaiwu.me - njs.git/commitdiff
CI: test njs with UBSan
authorDmitry Volyntsev <xeioex@nginx.com>
Sat, 12 Sep 2026 05:39:30 +0000 (22:39 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Mon, 14 Sep 2026 17:53:52 +0000 (10:53 -0700)
Build and run the base njs test suite with UndefinedBehaviorSanitizer.

.github/workflows/check-pr.yml

index 06d13ab90f0f9904887a4c25114b6ea1894049fc..f112873a32c84428c6a7eb4cbf1e5909520dd488 100644 (file)
@@ -65,17 +65,17 @@ jobs:
           meson install -C build
           echo "PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
 
-      - name: Configure and make njs
+      - name: Configure and make njs with UBSan
         run: |
           ./configure \
-                    --cc-opt="$CC_OPT" \
-                    --ld-opt="$LD_OPT" \
+                    --cc-opt="$CC_OPT -fsanitize=undefined" \
+                    --ld-opt="$LD_OPT -fsanitize=undefined" \
           || cat build/autoconf.err
           $MAKE_UTILITY -j$(nproc)
 
-      - name: Test njs
+      - name: Test njs with UBSan
         run: |
-          $MAKE_UTILITY test
+          UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 $MAKE_UTILITY test
           $MAKE_UTILITY clean
 
       - name: Configure and make njs, 32-bit