From 1dd0f4f6a7e5e64ad8d5c9ab200dea574b578dda Mon Sep 17 00:00:00 2001 From: Oscar Mira Date: Thu, 14 Mar 2019 23:47:22 +0100 Subject: [PATCH] add travis build with clang and address-sanitizer Create a new build job to run fuzz regression testing in travis. Also include a suppression file to ignore known memory leaks. --- .travis.yml | 29 ++++++++++++++++++++++++++++- Makefile.am | 1 + lsan.supp | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 lsan.supp diff --git a/.travis.yml b/.travis.yml index 2664c43b..44417ac0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,19 +10,22 @@ before_script: --with-jpeg-libraries=$JPEG/lib - make -j$JOBS -s script: - - make -Ctest -j$JOBS -s V=0 VERBOSE=1 check + - make -j$JOBS -s -k V=0 VERBOSE=1 check - LD_LIBRARY_PATH=$PWD/libvips/.libs DYLD_LIBRARY_PATH=$PWD/libvips/.libs + LD_PRELOAD=$ASAN_DSO $PYTHON -m pytest -v test/test-suite matrix: allow_failures: - os: osx + - compiler: clang fast_finish: true include: - os: linux sudo: required dist: xenial + compiler: gcc env: - PYTHON=python2 - PYVIPS_VERSION=master @@ -30,6 +33,29 @@ matrix: - JOBS=`nproc` cache: ccache + - os: linux + sudo: required + dist: xenial + compiler: clang + env: + - PYTHON=python2 + - PYVIPS_VERSION=master + - JPEG=/usr + - JOBS=`nproc` + - CFLAGS="-fsanitize=address -fno-omit-frame-pointer -fopenmp" + - LDFLAGS="-fsanitize=address -dynamic-asan -fopenmp=libiomp5" + - ASAN_DSO=/usr/local/clang-7.0.0/lib/clang/7.0.0/lib/linux/libclang_rt.asan-x86_64.so + - LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/lsan.supp" + - FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1 + install: + # add support for WebP + - wget http://archive.ubuntu.com/ubuntu/pool/main/libw/libwebp/libwebp-dev_0.6.1-2_amd64.deb + - wget http://archive.ubuntu.com/ubuntu/pool/main/libw/libwebp/libwebpdemux2_0.6.1-2_amd64.deb + - wget http://archive.ubuntu.com/ubuntu/pool/main/libw/libwebp/libwebpmux3_0.6.1-2_amd64.deb + - wget http://archive.ubuntu.com/ubuntu/pool/main/libw/libwebp/libwebp6_0.6.1-2_amd64.deb + - sudo dpkg -i *.deb + cache: ccache + - os: osx osx_image: xcode10.1 env: @@ -79,6 +105,7 @@ addons: - libgsf-1-dev - libopenslide-dev - libffi-dev + - libiomp-dev homebrew: packages: - ccache diff --git a/Makefile.am b/Makefile.am index 96b39889..4b622241 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,7 @@ EXTRA_DIST = \ vips.pc.in \ vips-cpp.pc.in \ libvips.supp \ + lsan.supp \ depcomp \ README.md diff --git a/lsan.supp b/lsan.supp new file mode 100644 index 00000000..9f48a038 --- /dev/null +++ b/lsan.supp @@ -0,0 +1 @@ +leak:vips_guess_prefix