]> granicus.if.org Git - postgis/commitdiff
Travis: Run CI under GCC's undefined behavior sanitizer
authorRaúl Marín Rodríguez <rmrodriguez@carto.com>
Mon, 19 Nov 2018 16:21:03 +0000 (16:21 +0000)
committerRaúl Marín Rodríguez <rmrodriguez@carto.com>
Mon, 19 Nov 2018 16:21:03 +0000 (16:21 +0000)
References #4244
Closes https://github.com/postgis/postgis/pull/335

git-svn-id: http://svn.osgeo.org/postgis/trunk@17034 b70326c6-7e19-0410-871a-916f4a2858ee

.travis.yml
ci/travis/run_usan_gcc.sh [new file with mode: 0644]

index 418ec5db188265de836f1251fe69fdcb23cd7456..97761f5e8d8119d8d9f4887e842e7ad04dd08f6b 100644 (file)
@@ -8,6 +8,7 @@ env:
   - tag=latest mode=tests
   - tag=pg11-geos37-gdal23-proj52 mode=debug
   - tag=pg11-geos37-gdal23-proj52 mode=coverage
+  - tag=pg11-geos37-gdal23-proj52 mode=usan_gcc
   - tag=pg11-geos37-gdal23-proj52 mode=tests
   - tag=pg10-geos36-gdal23-proj49 mode=tests
   - tag=pg96-geos36-gdal22-proj49 mode=tests
diff --git a/ci/travis/run_usan_gcc.sh b/ci/travis/run_usan_gcc.sh
new file mode 100644 (file)
index 0000000..332006e
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+set -e
+
+# Enable undefined behaviour sanitizer using traps to
+CFLAGS_STD="-g -O2 -mtune=generic -fno-omit-frame-pointer -fsanitize=undefined -fsanitize-undefined-trap-on-error"
+LDFLAGS_STD="-Wl,-Bsymbolic-functions -Wl,-z,relro"
+
+/usr/local/pgsql/bin/pg_ctl -c -l /tmp/logfile start
+./autogen.sh
+
+# Build with GCC and usan flags
+# TODO: Fix topology ubsan
+./configure CC=gcc CFLAGS="${CFLAGS_STD}" LDFLAGS="${LDFLAGS_STD}" --without-topology
+bash ./ci/travis/logbt -- make -j check RUNTESTFLAGS=--verbose