Skip to content

Commit

Permalink
tests: Avoid syslog() using a low fd on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
tavianator committed Nov 20, 2022
1 parent da02def commit 8b24de3
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions tests/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8b24de3

Please sign in to comment.