From: Remi Gacogne Date: Mon, 28 May 2018 07:57:14 +0000 (+0200) Subject: Enable Address (dnsdist, rec) and Undefined Behavior (dnsdist) Sanitizers X-Git-Tag: dnsdist-1.3.1~62^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=040e40bbce9f5f045ff2cbaae10b1ebe2c4c6c7c;p=pdns Enable Address (dnsdist, rec) and Undefined Behavior (dnsdist) Sanitizers Enabling UBSAN for the rec triggers a weird linking error in Travis: > clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation) I haven't been able to reproduce it, it might just be an OOM. --- diff --git a/build-scripts/travis.sh b/build-scripts/travis.sh index 43c7263cd..18419017b 100755 --- a/build-scripts/travis.sh +++ b/build-scripts/travis.sh @@ -377,6 +377,7 @@ build_auth() { run "autoreconf -vi" # Build without --enable-botan, no botan 2.x in Travis CI run "./configure \ + ${sanitizerflags} \ --with-dynmodules='bind gmysql geoip gpgsql gsqlite3 ldap lua mydns opendbx pipe random remote tinydns godbc lua2' \ --with-modules='' \ --with-sqlite3 \ @@ -405,6 +406,7 @@ build_recursor() { run "cd pdns-recursor-*" # Build without --enable-botan, no botan 2.x in Travis CI run "CXX=${COMPILER} ./configure \ + ${sanitizerflags} \ --prefix=$PDNS_RECURSOR_DIR \ --enable-libsodium \ --enable-unit-tests \ @@ -421,6 +423,7 @@ build_dnsdist(){ run "tar xf dnsdist*.tar.bz2" run "cd dnsdist-*" run "./configure \ + ${sanitizerflags} \ --enable-unit-tests \ --enable-libsodium \ --enable-dnscrypt \ @@ -611,12 +614,20 @@ run "sudo dpkg -i libsodium-dev_1.0.3-1~ppa14.04+1_amd64.deb libsodium13_1.0.3-1 run "cd ${TRAVIS_BUILD_DIR}" compilerflags="-O1 -Werror=vla" +sanitizerflags="" if [ "$CC" = "clang" ] then compilerflags="$compilerflags -Werror=string-plus-int" + if [ "${PDNS_BUILD_PRODUCT}" = "recursor" ]; then + sanitizerflags="${sanitizerflags} --enable-asan" + elif [ "${PDNS_BUILD_PRODUCT}" = "dnsdist" ]; then + sanitizerflags="${sanitizerflags} --enable-asan --enable-ubsan" + fi fi export CFLAGS=$compilerflags export CXXFLAGS=$compilerflags +export sanitizerflags +export UBSAN_OPTIONS="print_stacktrace=1:halt_on_error=1" install_$PDNS_BUILD_PRODUCT