Skip to content

Commit

Permalink
Enable ASan in the Testsuite (#5090)
Browse files Browse the repository at this point in the history
  • Loading branch information
Noordfrees committed Oct 27, 2021
1 parent 8846106 commit 4ce5e98
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ jobs:
os: ubuntu-18.04
config: Release
runs-on: ${{ matrix.os }}
env:
SDL_VIDEODRIVER: 'x11'
DISPLAY: ':99.0'
# TODO: Under Xvfb, the usual X11 memory leaks show up as an unsymbolized
# <unknown module> making them impossible to suppress. So we disable all
# memory leaks checking in the testsuite for now.
ASAN_OPTIONS: 'detect_leaks=0'
LSAN_OPTIONS: 'suppressions=${{ github.workspace }}/asan_3rd_party_leaks'
steps:
- name: Installing dependencies
run: |
Expand All @@ -154,24 +162,19 @@ jobs:
fi
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE:STRING="${{ matrix.config }}" -DOPTION_BUILD_TRANSLATIONS="ON" -DOPTION_BUILD_WEBSITE_TOOLS="ON" -DOPTION_ASAN="OFF" -DOPTION_BUILD_CODECHECK="OFF"
cmake .. -DCMAKE_BUILD_TYPE:STRING="${{ matrix.config }}" -DOPTION_BUILD_TRANSLATIONS="ON" -DOPTION_BUILD_WEBSITE_TOOLS="ON" -DOPTION_ASAN="ON" -DOPTION_BUILD_CODECHECK="OFF"
make -k -j$(nproc)
cd ..
- name: Website Binaries
run: |
/sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 800x600x24 -ac +extension GLX
sleep 1m
export SDL_VIDEODRIVER=x11
export DISPLAY=:99.0
# Ignore transient SDL errors (exit code 2)
mkdir temp_web
build/src/website/wl_map_object_info temp_web || [ $? -eq 2 ]
build/src/website/wl_map_info data/maps/Archipelago_Sea.wmf || [ $? -eq 2 ]
- name: Testsuite
run: |
export SDL_VIDEODRIVER=x11
export DISPLAY=:99.0
./regression_test.py -b build/src/widelands
run: ./regression_test.py -b build/src/widelands


windows:
Expand Down
12 changes: 12 additions & 0 deletions asan_3rd_party_leaks
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# List of known memory leaks in 3rd party libraries which we do not want ASan to report.

# SDL2
leak:libSDL2

# Eris
leak:src/scripting/persistence.cc

# Various graphics drivers and X11 stuff.
leak:libdbus
leak:libnvidia-glcore
leak:radeonsi_dri

0 comments on commit 4ce5e98

Please sign in to comment.