configure: abort on UBSan failure

By default, UBSan reports runtime errors but does not stop execution.
We already abort in debug builds, and this commit makes us also abort in
regular builds when UBSan is enabled. Arguably, this is what users
expect when they enable UBSan, so it is a good default.

I know I've missed some UBSan bugs in the past because of this issue,
and dergoegge mentioned that this also happened to him.
This commit is contained in:
Matt Morehouse 2023-12-11 13:12:26 -06:00 committed by Rusty Russell
parent d759f3b758
commit 968d6d6d24

5
configure vendored
View File

@ -165,10 +165,7 @@ set_defaults()
fi
fi
if [ "$UBSAN" != 0 ]; then
CSANFLAGS="$CSANFLAGS -fsanitize=undefined"
if [ "$DEBUGBUILD" != 0 ]; then
CSANFLAGS="$CSANFLAGS -fno-sanitize-recover=undefined"
fi
CSANFLAGS="$CSANFLAGS -fsanitize=undefined -fno-sanitize-recover=undefined"
fi
if [ "$FUZZING" != 0 ]; then
FUZZFLAGS="-fsanitize=fuzzer-no-link -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"