Improve use of GCC sanitizers in CI runs (#811)

* Suppress leaks reported in system libraries during LSAN run

* Remove thread sanitizer (TSAN) from CI GCC analysis run

Previously TSAN provided no meaningful results when DOSBox was
launched inside CI with the "immediate exit" command, ie:

  dosbox -c exit

However, allowing it to initialize registered "programs"
and the mixer (and so on) does produce meaningful results,
which we accomplish using AUTOTYPE to type "exit" for us:

  dosbox -c "autotype e x i t enter"

However, within CI, we use the virtual X11 environment, which
unfortunately now conflicts with the TSAN harness, causing XVFB
itself to segfault (without any TSAN harness output):

  SEGV on unknown address 0x000000000000
  pc 0x000000000000 bp 0x7ffdf8bf4510 sp 0x7ffdf8bf44c8 T10341
  : 1

Threfore, because both ways of running TSAN aren't effective
within a GUI-less CI environment, this commit removes it for now.

TSAN works perfectly locally however, and the results are valid:
  ./build.sh -c gcc -t tsan
  <run like normal>
This commit is contained in:
kcgen 2021-01-10 18:56:31 -08:00 committed by GitHub
parent d6ed9a9ef9
commit 0a244489f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 11 deletions

View file

@ -35,6 +35,9 @@ cd "$(dirname "${0}")/../.."
# Make a directory to hold our build and run output
mkdir -p "${logs}"
# SAN-specific environment variables
export LSAN_OPTIONS="suppressions=.lsan-suppress:verbosity=0"
for sanitizer in "${sanitizers[@]}"; do
# Build DOSBox for each sanitizer
@ -47,7 +50,7 @@ for sanitizer in "${sanitizers[@]}"; do
# Exercise the testcase(s) for each sanitizer
# Sanitizers return non-zero if one or more issues were found,
# so we or-to-true to ensure our script doesn't end here.
time xvfb-run ./src/dosbox -c exit \
time xvfb-run ./src/dosbox -c "autotype -w 0.1 e x i t enter" \
&> "${logs}/${compiler}-${sanitizer}-EnterExit.log" || true
done

View file

@ -99,12 +99,11 @@ jobs:
- name: Clang
sanitizers: USAN
usan: 0 # cleared out in our existing tests
tsan: -1
uasan: -1
- name: GCC
sanitizers: TSAN UASAN
# TSAN excluded, harness segfaults inside virual-X11 environment
sanitizers: UASAN
usan: -1
tsan: 0 # our test does not trigger multiple threads yet
uasan: 15
steps:
- uses: actions/checkout@v2
@ -150,7 +149,6 @@ jobs:
- name: Summarize issues
env:
USAN_LOG: ${{ matrix.conf.name }}-logs/${{ matrix.conf.name }}-USAN-EnterExit.log.xz
TSAN_LOG: ${{ matrix.conf.name }}-logs/${{ matrix.conf.name }}-TSAN-EnterExit.log.xz
UASAN_LOG: ${{ matrix.conf.name }}-logs/${{ matrix.conf.name }}-UASAN-EnterExit.log.xz
run: |
# summary
@ -165,12 +163,6 @@ jobs:
xzcat "$USAN_LOG" | MAX_ISSUES=${{ matrix.conf.usan }} ./scripts/count-xsan-issues.py -
fi
if [[ -f "$TSAN_LOG" ]] ; then
echo_bold "Thread sanitizer:"
echo
xzcat "$TSAN_LOG" | MAX_ISSUES=${{ matrix.conf.tsan }} ./scripts/count-xsan-issues.py -
fi
if [[ -f "$UASAN_LOG" ]] ; then
echo_bold "Undefined Behaviour + Address sanitizers:"
echo

2
.lsan-suppress Normal file
View file

@ -0,0 +1,2 @@
leak:/usr/lib/x86_64-linux-gnu/dri
leak:/lib/x86_64-linux-gnu