From cf655c6fbe42558d03318e51e962557a91fdef4d Mon Sep 17 00:00:00 2001 From: Oscar Mira Date: Fri, 2 Aug 2019 11:39:14 +0200 Subject: [PATCH 1/2] fix fuzzing specific build macro --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9d138895..f6923abd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,11 +41,10 @@ matrix: - PYVIPS_VERSION=master - JPEG=/usr - JOBS=`nproc` - - CFLAGS="-fsanitize=address -fno-omit-frame-pointer -fopenmp" + - CFLAGS="-fsanitize=address -fno-omit-frame-pointer -fopenmp -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" - 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 From 78c0014708c3536773decba44b555c48b9b33f53 Mon Sep 17 00:00:00 2001 From: Oscar Mira Date: Fri, 2 Aug 2019 12:23:39 +0200 Subject: [PATCH 2/2] add UBSAN sanitizer --- .travis.yml | 4 ++-- fuzz/test_fuzz.sh | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f6923abd..f7c4ba4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,8 +41,8 @@ matrix: - PYVIPS_VERSION=master - JPEG=/usr - JOBS=`nproc` - - CFLAGS="-fsanitize=address -fno-omit-frame-pointer -fopenmp -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" - - LDFLAGS="-fsanitize=address -dynamic-asan -fopenmp=libiomp5" + - CFLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -fopenmp -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" + - LDFLAGS="-fsanitize=address,undefined -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" install: diff --git a/fuzz/test_fuzz.sh b/fuzz/test_fuzz.sh index 02af3c48..dd4decb5 100755 --- a/fuzz/test_fuzz.sh +++ b/fuzz/test_fuzz.sh @@ -6,6 +6,7 @@ set -e # Glib is build without -fno-omit-frame-pointer. We need # to disable the fast unwinder to get full stacktraces. export ASAN_OPTIONS="fast_unwind_on_malloc=0:allocator_may_return_null=1" +export UBSAN_OPTIONS="print_stacktrace=1" # Hide all warning messages from vips. export VIPS_WARNING=0