wxWidgets/.github/workflows/ci.yml
Vadim Zeitlin ef1bf6df1f Disable fast unwind on malloc in ASAN builds
This makes things much, much slower, but unfortunately seems to be the
only way to avoid memory leak reports when running the tests as without
it the suppression is not used because the stack is truncated, i.e. we
only see

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f0968253bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
    #1 0x7f09675aacb8 in g_malloc ../../../glib/gmem.c:102

in the output when the actual stack, seen with fast_unwind_on_malloc=0, is

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f12b913bbc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
    #1 0x7f12b8496cd8 in g_malloc ../../../glib/gmem.c:102
    #2 0x7f12b84b0f93 in g_strdup ../../../glib/gstrfuncs.c:363
    #3 0x7f12b49adb2a in atk_bridge_adaptor_init ../atk-adaptor/bridge.c:1039
    #4 0x7f12b566d753 in _gtk_accessibility_init ../../../../gtk/a11y/gtkaccessibility.c:992
    #5 0x7f12b5821cfc in default_display_notify_cb ../../../../gtk/gtkmain.c:714
    #6 0x7f12b5589801 in g_closure_invoke ../../../gobject/gclosure.c:810
    #7 0x7f12b559d813 in signal_emit_unlocked_R ../../../gobject/gsignal.c:3742
    #8 0x7f12b55a8b9d in g_signal_emit_valist ../../../gobject/gsignal.c:3498
    #9 0x7f12b55a90d2 in g_signal_emit ../../../gobject/gsignal.c:3554
    #10 0x7f12b558e283 in g_object_dispatch_properties_changed ../../../gobject/gobject.c:1206
    #11 0x7f12b55906f1 in g_object_notify_by_spec_internal ../../../gobject/gobject.c:1299
    #12 0x7f12b55906f1 in g_object_notify ../../../gobject/gobject.c:1347
    #13 0x7f12b5dbf54f in _gdk_display_manager_add_display ../../../../gdk/gdkdisplaymanager.c:479
    #14 0x7f12b5589a55 in _g_closure_invoke_va ../../../gobject/gclosure.c:873
    #15 0x7f12b55a8b27 in g_signal_emit_valist ../../../gobject/gsignal.c:3407
    #16 0x7f12b55a9b7b in g_signal_emit_by_name ../../../gobject/gsignal.c:3594
    #17 0x7f12b5ded21a in _gdk_x11_display_open ../../../../../gdk/x11/gdkdisplay-x11.c:1803
    #18 0x7f12b5dbf377 in gdk_display_manager_open_display ../../../../gdk/gdkdisplaymanager.c:462
    #19 0x7f12b5822f6a in gtk_init_check ../../../../gtk/gtkmain.c:1109
    #20 0x7f12b5822f6a in gtk_init_check ../../../../gtk/gtkmain.c:1101
    #21 0x7f12b6fd1dad in wxApp::Initialize(int&, wchar_t**)
    ...
2021-01-31 17:33:13 +01:00

216 lines
7.3 KiB
YAML

# Continuous integration workflow for wxWidgets.
name: GitHub CI
on:
push:
branches:
- master
paths-ignore:
- 'docs'
- 'interface'
pull_request:
branches:
- master
paths-ignore:
- 'docs'
- 'interface'
jobs:
build:
runs-on: ${{ matrix.runner }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu 16.04 wxGTK 2
runner: ubuntu-16.04
gtk_version: 2
use_xvfb: true
- name: Ubuntu 16.04 wxGTK 3 static
runner: ubuntu-16.04
configure_flags: --disable-shared
use_xvfb: true
- name: Ubuntu 18.04 wxGTK 2 UTF-8
runner: ubuntu-18.04
gtk_version: 2
configure_flags: --enable-utf8 --enable-utf8only --enable-monolithic
use_xvfb: true
- name: Ubuntu 18.04 wxGTK 3 STL
runner: ubuntu-18.04
configure_flags: --enable-cxx11 --enable-stl --disable-compat30
use_xvfb: true
- name: Ubuntu 18.04 wxGTK 3 with clang
runner: ubuntu-18.04
compiler: clang
configure_flags: --disable-sys-libs --with-libcurl
use_xvfb: true
- name: Ubuntu 20.04 wxGTK ANSI
runner: ubuntu-20.04
configure_flags: --disable-unicode
skip_samples: true
- name: Ubuntu 20.04 wxGTK with ASAN
runner: ubuntu-20.04
configure_flags: --disable-compat30 --disable-sys-libs --with-libcurl --disable-webview
skip_samples: true
use_asan: true
use_xvfb: true
- name: Ubuntu 18.04 wxX11
runner: ubuntu-18.04
configure_flags: --with-x11 --enable-pch --disable-stc
skip_samples: true
- name: Ubuntu 18.04 wxDFB
runner: ubuntu-18.04
configure_flags: --with-directfb --enable-pch --disable-stc
skip_samples: true
allow_warnings: true
- name: Ubuntu 18.04 wxMotif
runner: ubuntu-18.04
configure_flags: --with-motif --enable-pch --disable-stc
skip_samples: true
- name: Ubuntu 18.04 wxQt
runner: ubuntu-18.04
configure_flags: --with-qt --enable-pch --without-opengl
skip_samples: true
env:
wxGTK_VERSION: ${{ matrix.gtk_version && matrix.gtk_version || 3 }}
wxCONFIGURE_FLAGS: ${{ matrix.configure_flags }}
wxUSE_ASAN: ${{ matrix.use_asan && 1 || 0 }}
wxUSE_XVFB: ${{ matrix.use_xvfb && 1 || 0 }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set environment variables
run: |
echo LD_LIBRARY_PATH=`pwd`/lib >> $GITHUB_ENV
wxPROC_COUNT=`nproc`
((wxPROC_COUNT++))
echo wxPROC_COUNT=$wxPROC_COUNT >> $GITHUB_ENV
echo wxBUILD_ARGS=-j$wxPROC_COUNT >> $GITHUB_ENV
# Setting this variable suppresses "Error retrieving accessibility bus address"
# messages from WebKit tests that we're not interested in.
echo NO_AT_BRIDGE=1 >> $GITHUB_ENV
case "${{ matrix.compiler }}" in
clang)
echo CC=clang >> $GITHUB_ENV
echo CXX=clang++ >> $GITHUB_ENV
echo LD=clang++ >> $GITHUB_ENV
allow_warn_opt="-Wno-error=#warnings"
;;
'')
# Assume gcc.
allow_warn_opt="-Wno-error=cpp"
;;
*)
echo "*** Unknown compiler: ${{ matrix.compiler }} ***"
;;
esac
if [ -z ${{ matrix.allow_warnings }} ]; then
error_opts="-Werror $allow_warn_opt"
echo "wxMAKEFILE_ERROR_CXXFLAGS=$error_opts" >> $GITHUB_ENV
echo "wxMAKEFILE_CXXFLAGS=$wxMAKEFILE_CXXFLAGS $error_opts" >> $GITHUB_ENV
fi
echo "wxMAKEFILE_CXXFLAGS=$wxMAKEFILE_CXXFLAGS $error_opts" >> $GITHUB_ENV
- name: Before install
run: |
./build/tools/before_install.sh
- name: Configuring
run: |
wxCONFIGURE_OPTIONS="--disable-optimise $wxCONFIGURE_FLAGS"
if [ -n "${{ matrix.gtk_version }}" ]; then
wxCONFIGURE_OPTIONS="--with-gtk=${{ matrix.gtk_version }} $wxCONFIGURE_OPTIONS"
fi
if [ ${{ matrix.use_asan }} ]; then
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
echo '*** Configuring failed, contents of config.log follows: ***'
echo '-----------------------------------------------------------'
cat config.log
echo '-----------------------------------------------------------'
exit $rc
fi
- name: Building
run: |
make -k $wxBUILD_ARGS "CXXFLAGS=$wxMAKEFILE_ERROR_CXXFLAGS"
- name: Building tests
run: |
if [ !${{ matrix.skip_gui }} ]; then
make -C tests $wxBUILD_ARGS failtest
fi
make -k -C tests $wxBUILD_ARGS "CXXFLAGS=$wxMAKEFILE_CXXFLAGS" "LDFLAGS=$wxMAKEFILE_LDFLAGS"
- name: Launching httpbin
if: matrix.skip_testing != true
run: |
pip install httpbin
python -m httpbin.core 2>&1 >httpbin.log &
echo 'WX_TEST_WEBREQUEST_URL=http://localhost:5000' >> $GITHUB_ENV
- name: Testing
if: matrix.skip_testing != true
run: |
echo 'Testing...'
pushd tests
./test || rc=$?
popd
if [ -n "$rc" ]; then
echo '*** Tests failed, contents of httpbin.log follows: ***'
echo '-----------------------------------------------------------'
cat httpbin.log
echo '-----------------------------------------------------------'
exit $rc
fi
- name: Testing GUI using Xvfb
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
fi
pushd tests
xvfb-run -a -s '-screen 0 1600x1200x24' ./test_gui
popd
- name: Building samples
if: matrix.skip_testing != true && matrix.skip_gui != true && matrix.skip_samples != true
run: |
make -k $wxBUILD_ARGS "CXXFLAGS=$wxMAKEFILE_CXXFLAGS" "LDFLAGS=$wxMAKEFILE_LDFLAGS" samples
- name: Installing
if: matrix.skip_testing != true
run: |
sudo make install
- name: Testing installation
if: matrix.skip_testing != true
run: |
make -C samples/minimal -f makefile.unx clean
make -C samples/minimal -f makefile.unx $wxBUILD_ARGS "CXXFLAGS=$wxMAKEFILE_CXXFLAGS" "LDFLAGS=$wxMAKEFILE_LDFLAGS"