From f43df8a8630889b36cc396f2066492a7d518db5a Mon Sep 17 00:00:00 2001 From: David Sterba Date: Fri, 2 Oct 2020 20:58:24 +0200 Subject: [PATCH] btrfs-progs: ci: add sanitizer coverage Add builds with ASAN and UBSAN for both gcc. Clang + asan fails at some tests due to wrong asan runtime, clang + ubsan fails at libbtrfsutil/btrfsutil_internal.h:71:20: memcpy(&tmp, &sh->type, sizeof(__u32)); which seems to be too strict. [TEST/cli] 008-subvolume-get-set-default subvolume get-default: default id is not 256, but libbtrfsutil/btrfsutil_internal.h:71:20: runtime error: member access within misaligned address 0x7ffcc8017f67 for type 'const struct btrfs_ioctl_search_header', which requires 8 byte alignment 0x7ffcc8017f67: note: pointer points here 00 00 00 00 07 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 05 00 00 00 00 00 00 00 90 00 00 00 ^ libbtrfsutil/btrfsutil_internal.h:64:20: runtime error: member access within misaligned address 0x7ffcc8017f67 for type 'const struct btrfs_ioctl_search_header', which requires 8 byte alignment 0x7ffcc8017f67: note: pointer points here 00 00 00 00 07 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 05 00 00 00 00 00 00 00 90 00 00 00 ^ libbtrfsutil/btrfsutil_internal.h:78:20: runtime error: member access within misaligned address 0x7ffcc8017f67 for type 'const struct btrfs_ioctl_search_header', which requires 8 byte alignment 0x7ffcc8017f67: note: pointer points here 00 00 00 00 07 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 05 00 00 00 00 00 00 00 90 00 00 00 Signed-off-by: David Sterba --- .travis.yml | 18 ++++++++++++++---- ci/build-default | 1 + 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8404e26d..40d603f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,9 +19,19 @@ sudo: required language: c -compiler: - - gcc - - clang + +matrix: + include: + - os: linux + compiler: gcc + - os: linux + compiler: gcc + env: D=asan + - os: linux + compiler: gcc + env: D=ubsan + - os: linux + compiler: clang cache: ccache: true @@ -73,7 +83,7 @@ addons: script: # quick build tests - "if ci/should-run-test; then docker run -it --env CC=$CC kdave/ci-musl-x86_64 ./test-build $TRAVIS_BRANCH --disable-documentation --disable-backtrace; fi" - - "if ci/should-run-test; then make TEST_LOG=dump library-test; fi" + - "if ci/should-run-test && ci/not-asan-build; then make TEST_LOG=dump library-test; fi" # real tests - "if ci/should-run-test; then make TEST_LOG=dump test-cli; fi" - "if ci/should-run-test; then make TEST_LOG=dump test-mkfs; fi" diff --git a/ci/build-default b/ci/build-default index b43302d9..28f5e2be 100755 --- a/ci/build-default +++ b/ci/build-default @@ -10,4 +10,5 @@ set -e ./autogen.sh ./configure "$@" +echo "D=$D" make