Skip to content

Commit

Permalink
ci: Combine UBSAN and ASAN by default
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cgwalters authored and rh-atomic-bot committed Dec 9, 2016
1 parent 67ce5ec commit 5aefe17
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .redhat-ci.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ RUN dnf install -y \
parallel \
clang \
libubsan \
libasan \
libtsan \
gnome-desktop-testing \
redhat-rpm-config \
elfutils \
Expand Down
7 changes: 6 additions & 1 deletion .redhat-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ required: true
container:
image: projectatomic/ostree-tester

packages:
- libasan

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:
config-opts: >
Expand Down
7 changes: 2 additions & 5 deletions Makefile-tests.am
Original file line number Diff line number Diff line change
Expand Up @@ -281,18 +281,15 @@ tests/%-symlink-stamp: % Makefile
# non-recursive Automake, so we change our code to canonically look
# for tests/ which is just a symlink when installed.
if ENABLE_INSTALLED_TESTS
install-test-data-file-path-hack:
install-installed-tests-extra:
if test -L $(DESTDIR)$(installed_testdir)/tests; then \
rm $(DESTDIR)$(installed_testdir)/tests; \
fi
ln -s . $(DESTDIR)$(installed_testdir)/tests
INSTALL_DATA_HOOKS += install-test-data-file-path-hack

install-libtest:
if BUILDOPT_ASAN
sed -e 's,^BUILT_WITH_ASAN=.*,BUILT_WITH_ASAN=1,' < $(srcdir)/tests/libtest.sh > $(DESTDIR)$(installed_testdir)/tests/libtest.sh
else
install -m 0644 $(srcdir)/tests/libtest.sh $(DESTDIR)$(installed_testdir)/tests/libtest.sh
endif
INSTALL_DATA_HOOKS += install-libtest
INSTALL_DATA_HOOKS += install-installed-tests-extra
endif

0 comments on commit 5aefe17

Please sign in to comment.