From 5aefe17ee984e32e09bf24f2e3ef57cb78c7914c Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 7 Dec 2016 21:26:43 -0500 Subject: [PATCH] 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 --- .redhat-ci.Dockerfile | 2 ++ .redhat-ci.yml | 7 ++++++- Makefile-tests.am | 7 ++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.redhat-ci.Dockerfile b/.redhat-ci.Dockerfile index f1a4129968..c78e5c4cb9 100644 --- a/.redhat-ci.Dockerfile +++ b/.redhat-ci.Dockerfile @@ -11,6 +11,8 @@ RUN dnf install -y \ parallel \ clang \ libubsan \ + libasan \ + libtsan \ gnome-desktop-testing \ redhat-rpm-config \ elfutils \ diff --git a/.redhat-ci.yml b/.redhat-ci.yml index 33e329955c..5160b9c41f 100644 --- a/.redhat-ci.yml +++ b/.redhat-ci.yml @@ -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: > diff --git a/Makefile-tests.am b/Makefile-tests.am index 8c37a6e6e6..1f9cad48b5 100644 --- a/Makefile-tests.am +++ b/Makefile-tests.am @@ -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