summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-11-19 11:00:15 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-11-20 18:17:33 -0500
commit8b24de3882ff5a3e33b82ab20bb4eadf134cf559 (patch)
tree0f36299fe981f15918484289b693bc8aab3afa76
parentda02defb91c3a1bda0ea7e653d81f997f1c8884a (diff)
downloadbfs-8b24de3882ff5a3e33b82ab20bb4eadf134cf559.tar.xz
tests: Avoid syslog() using a low fd on macOS
-rwxr-xr-xtests/tests.sh21
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/tests.sh b/tests/tests.sh
index 8d13aca..26c993f 100755
--- a/tests/tests.sh
+++ b/tests/tests.sh
@@ -22,11 +22,11 @@ umask 022
export LC_ALL=C
export TZ=UTC0
-export ASAN_OPTIONS="abort_on_error=1"
-export LSAN_OPTIONS="abort_on_error=1"
-export MSAN_OPTIONS="abort_on_error=1"
-export TSAN_OPTIONS="abort_on_error=1"
-export UBSAN_OPTIONS="abort_on_error=1"
+export ASAN_OPTIONS="abort_on_error=1:log_to_syslog=0"
+export LSAN_OPTIONS="abort_on_error=1:log_to_syslog=0"
+export MSAN_OPTIONS="abort_on_error=1:log_to_syslog=0"
+export TSAN_OPTIONS="abort_on_error=1:log_to_syslog=0"
+export UBSAN_OPTIONS="abort_on_error=1:log_to_syslog=0"
export LS_COLORS=""
unset BFS_COLORS
@@ -53,6 +53,17 @@ fi
UNAME=$(uname)
+if [ "$UNAME" = Darwin ]; then
+ # ASan on macOS likes to report
+ #
+ # malloc: nano zone abandoned due to inability to preallocate reserved vm space.
+ #
+ # to syslog, which as a side effect opens a socket which might take the
+ # place of one of the standard streams if the process is launched with it
+ # closed. This environment variable avoids the message.
+ export MallocNanoZone=0
+fi
+
if command -v capsh &>/dev/null; then
if capsh --has-p=cap_dac_override &>/dev/null || capsh --has-p=cap_dac_read_search &>/dev/null; then
if [ -n "${BFS_TRIED_DROP:-}" ]; then