Disable leak detection if debug symbols are unavailable

There just doesn't seem to be any way to make this work right now, so
handle dbgsym packages installation failure and disable leak detection
in this case.

Hopefully ddebs.ubuntu.com repository will be updated in the future,
allowing this to work again.
This commit is contained in:
Vadim Zeitlin
2021-03-23 13:36:48 +01:00
parent c471699187
commit a47bb47165
2 changed files with 22 additions and 4 deletions

View File

@@ -222,8 +222,15 @@ jobs:
if: matrix.skip_testing != true && matrix.skip_gui != true && matrix.use_xvfb
run: |
if [ ${{ matrix.use_asan }} ]; then
export LSAN_OPTIONS=suppressions=$(pwd)/misc/suppressions/lsan
export ASAN_OPTIONS=fast_unwind_on_malloc=0
# Leak suppression only works if we have debug symbols available,
# otherwise we disable it to avoid tons of reports about leaks in
# libfontconfig etc.
if [ -f wx_dbgsym_available ]; then
export LSAN_OPTIONS=suppressions=$(pwd)/misc/suppressions/lsan
else
ASAN_OPTIONS=detect_leaks=0
fi
export ASAN_OPTIONS="$ASAN_OPTIONS fast_unwind_on_malloc=0"
fi
pushd tests
xvfb-run -a -s '-screen 0 1600x1200x24' ./test_gui

View File

@@ -43,7 +43,7 @@ case $(uname -s) in
wget -O - http://ddebs.ubuntu.com/dbgsym-release-key.asc | $SUDO apt-key add -
# Install the symbols to allow LSAN suppression list to work.
pkg_install='libfontconfig1-dbgsym libglib2.0-0-dbgsym libgtk-3-0-dbgsym libatk-bridge2.0-0-dbgsym'
dbgsym_pkgs='libfontconfig1-dbgsym libglib2.0-0-dbgsym libgtk-3-0-dbgsym libatk-bridge2.0-0-dbgsym'
fi
run_apt update
@@ -85,7 +85,18 @@ case $(uname -s) in
fi
done
run_apt install -y $pkg_install
if ! run_apt install -y $pkg_install $dbgsym_pkgs; then
if [ -z "$dbgsym_pkgs" ]; then
exit $?
fi
# Retry without dbgsym packages that currently fail to install
# under Ubuntu Focal (20.04).
echo 'Installing with dbgsym packages failed, retrying without...'
run_apt install -y $pkg_install
else
touch wx_dbgsym_available
fi
fi
;;