Add wxGTK build with ASAN to Travis CI

Compile and link with `-fsanitize=address` options to find memory related
errors.
This commit is contained in:
Ilya Sinitsyn
2020-10-13 20:26:58 +07:00
committed by Vadim Zeitlin
parent fe7230e19c
commit 0310347dc4
3 changed files with 41 additions and 1 deletions

View File

@@ -38,6 +38,10 @@ jobs:
compiler: gcc compiler: gcc
env: wxCONFIGURE_FLAGS="--disable-compat30 --disable-optimise --disable-unicode" wxSKIP_SAMPLES=1 env: wxCONFIGURE_FLAGS="--disable-compat30 --disable-optimise --disable-unicode" wxSKIP_SAMPLES=1
name: wxGTK ANSI Ubuntu 20.04 name: wxGTK ANSI Ubuntu 20.04
- dist: focal
compiler: gcc
env: wxCONFIGURE_FLAGS="--disable-compat30 --disable-sys-libs" wxSKIP_SAMPLES=1 wxUSE_ASAN=1
name: wxGTK Ubuntu 20.04 with ASAN
- os: osx - os: osx
osx_image: xcode7.3 osx_image: xcode7.3
compiler: clang compiler: clang

View File

@@ -42,6 +42,24 @@ case $(uname -s) in
done done
$SUDO apt-get install -y $libtoolkit_dev $pkg_install $SUDO apt-get install -y $libtoolkit_dev $pkg_install
if [ "$wxUSE_ASAN" = 1 ]; then
codename=$(lsb_release --codename --short)
# Enable the `-dbgsym` repositories.
echo "deb http://ddebs.ubuntu.com ${codename} main restricted universe multiverse
deb http://ddebs.ubuntu.com ${codename}-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com ${codename}-proposed main restricted universe multiverse" | \
$SUDO tee --append /etc/apt/sources.list.d/ddebs.list
# Import the debug symbol archive signing key from the Ubuntu server.
# Note that this command works only on Ubuntu 18.04 LTS and newer.
$SUDO apt-get install -y ubuntu-dbgsym-keyring
$SUDO apt-get update
# Install the symbols to allow LSAN suppression list to work.
$SUDO apt-get install -y libfontconfig1-dbgsym
fi
fi fi
;; ;;

View File

@@ -21,6 +21,11 @@ case $wxTOOLSET in
fi fi
cmake --version cmake --version
if [ "$wxUSE_ASAN" = 1 ]; then
echo "ASAN currently isn't supported in CMake builds"
exit 1
fi
echo 'travis_fold:start:configure' echo 'travis_fold:start:configure'
echo 'Configuring...' echo 'Configuring...'
mkdir build_cmake mkdir build_cmake
@@ -61,7 +66,20 @@ case $wxTOOLSET in
*) *)
echo 'travis_fold:start:configure' echo 'travis_fold:start:configure'
echo 'Configuring...' echo 'Configuring...'
./configure --disable-optimise --disable-debug_info $wxCONFIGURE_FLAGS || rc=$?
wxCONFIGURE_OPTIONS="--disable-optimise $wxCONFIGURE_FLAGS"
if [ "$wxUSE_ASAN" = 1 ]; then
export LSAN_OPTIONS=suppressions=$(pwd)/misc/suppressions/lsan
wxASAN_CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
wxASAN_CXXFLAGS=$wxASAN_CFLAGS
wxASAN_LDFLAGS="-fsanitize=address"
./configure $wxCONFIGURE_OPTIONS --enable-debug "CFLAGS=$wxASAN_CFLAGS" "CXXFLAGS=$wxASAN_CXXFLAGS" "LDFLAGS=$wxASAN_LDFLAGS" || rc=$?
else
./configure $wxCONFIGURE_OPTIONS --disable-debug_info || rc=$?
fi
if [ -n "$rc" ]; then if [ -n "$rc" ]; then
echo '*** Configuring failed, contents of config.log follows: ***' echo '*** Configuring failed, contents of config.log follows: ***'
echo '-----------------------------------------------------------' echo '-----------------------------------------------------------'