ci: Combine UBSAN and ASAN by default

I only recently realized this was possible.  While we're still seeing
leaks in the CI environment for some reason, adding ASAN gives us
use-after-free detection etc., which is obviously still very useful
even if we're not doing leak checking.

Closes: #622
Approved by: jlebon
This commit is contained in:
Colin Walters 2016-12-07 21:26:43 -05:00 committed by Atomic Bot
parent 67ce5ec917
commit 5aefe17ee9
3 changed files with 10 additions and 6 deletions

View File

@ -11,6 +11,8 @@ RUN dnf install -y \
parallel \ parallel \
clang \ clang \
libubsan \ libubsan \
libasan \
libtsan \
gnome-desktop-testing \ gnome-desktop-testing \
redhat-rpm-config \ redhat-rpm-config \
elfutils \ elfutils \

View File

@ -8,8 +8,13 @@ required: true
container: container:
image: projectatomic/ostree-tester image: projectatomic/ostree-tester
packages:
- libasan
env: env:
CFLAGS: '-fsanitize=undefined' CFLAGS: '-fsanitize=undefined -fsanitize=address'
ASAN_OPTIONS: 'detect_leaks=0' # Right now we're not fully clean, but this gets us use-after-free etc
# TODO when we're doing leak checks: G_SLICE: "always-malloc"
build: build:
config-opts: > config-opts: >

View File

@ -281,18 +281,15 @@ tests/%-symlink-stamp: % Makefile
# non-recursive Automake, so we change our code to canonically look # non-recursive Automake, so we change our code to canonically look
# for tests/ which is just a symlink when installed. # for tests/ which is just a symlink when installed.
if ENABLE_INSTALLED_TESTS if ENABLE_INSTALLED_TESTS
install-test-data-file-path-hack: install-installed-tests-extra:
if test -L $(DESTDIR)$(installed_testdir)/tests; then \ if test -L $(DESTDIR)$(installed_testdir)/tests; then \
rm $(DESTDIR)$(installed_testdir)/tests; \ rm $(DESTDIR)$(installed_testdir)/tests; \
fi fi
ln -s . $(DESTDIR)$(installed_testdir)/tests ln -s . $(DESTDIR)$(installed_testdir)/tests
INSTALL_DATA_HOOKS += install-test-data-file-path-hack
install-libtest:
if BUILDOPT_ASAN if BUILDOPT_ASAN
sed -e 's,^BUILT_WITH_ASAN=.*,BUILT_WITH_ASAN=1,' < $(srcdir)/tests/libtest.sh > $(DESTDIR)$(installed_testdir)/tests/libtest.sh sed -e 's,^BUILT_WITH_ASAN=.*,BUILT_WITH_ASAN=1,' < $(srcdir)/tests/libtest.sh > $(DESTDIR)$(installed_testdir)/tests/libtest.sh
else else
install -m 0644 $(srcdir)/tests/libtest.sh $(DESTDIR)$(installed_testdir)/tests/libtest.sh install -m 0644 $(srcdir)/tests/libtest.sh $(DESTDIR)$(installed_testdir)/tests/libtest.sh
endif endif
INSTALL_DATA_HOOKS += install-libtest INSTALL_DATA_HOOKS += install-installed-tests-extra
endif endif