Skip to content

Commit

Permalink
configure: abort on UBSan failure
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
morehouse authored and rustyrussell committed Feb 1, 2024
1 parent d759f3b commit 968d6d6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 968d6d6

Please sign in to comment.