From 054120002d08fde99bd221eae567b16772a55411 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 6 Nov 2023 23:17:27 +0100 Subject: [PATCH] Exit on sanitizer trap, don't recover Fixes: https://github.com/quickjs-ng/quickjs/issues/22 --- .github/workflows/ci.yml | 10 +++++----- Makefile | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bafc104c..0ab4854f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,21 +33,21 @@ jobs: - uses: actions/checkout@v3 - name: test run: | - make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y test + make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y ASAN_OPTIONS="halt_on_error=1" test linux-msan: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: test run: | - make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_MSAN=y CONFIG_CLANG=y test + make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_MSAN=y CONFIG_CLANG=y MSAN_OPTIONS="halt_on_error=1" test linux-ubsan: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: test run: | - make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_UBSAN=y test + make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_UBSAN=y UBSAN_OPTIONS="halt_on_error=1" test macos: runs-on: macos-latest @@ -69,11 +69,11 @@ jobs: - uses: actions/checkout@v3 - name: test run: | - make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y test + make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y ASAN_OPTIONS="halt_on_error=1" test macos-ubsan: runs-on: macos-latest steps: - uses: actions/checkout@v3 - name: test run: | - make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_UBSAN=y test + make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_UBSAN=y UBSAN_OPTIONS="halt_on_error=1" test diff --git a/Makefile b/Makefile index cafd3fd6..ca4e74aa 100644 --- a/Makefile +++ b/Makefile @@ -128,16 +128,16 @@ CFLAGS+=-p LDFLAGS+=-p endif ifdef CONFIG_ASAN -CFLAGS+=-fsanitize=address -fno-omit-frame-pointer -LDFLAGS+=-fsanitize=address -fno-omit-frame-pointer +CFLAGS+=-fsanitize=address -fno-sanitize-recover=all -fno-omit-frame-pointer +LDFLAGS+=-fsanitize=address -fno-sanitize-recover=all -fno-omit-frame-pointer endif ifdef CONFIG_MSAN -CFLAGS+=-fsanitize=memory -fno-omit-frame-pointer -LDFLAGS+=-fsanitize=memory -fno-omit-frame-pointer +CFLAGS+=-fsanitize=memory -fno-sanitize-recover=all -fno-omit-frame-pointer +LDFLAGS+=-fsanitize=memory -fno-sanitize-recover=all -fno-omit-frame-pointer endif ifdef CONFIG_UBSAN -CFLAGS+=-fsanitize=undefined -fno-omit-frame-pointer -LDFLAGS+=-fsanitize=undefined -fno-omit-frame-pointer +CFLAGS+=-fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer +LDFLAGS+=-fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer endif ifdef CONFIG_WIN32 LDEXPORT=