aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-14 12:36:02 +0000
committerGitHub <noreply@github.com>2018-11-14 12:36:02 +0000
commit77ae701e0e023925e3399c2efc5a1aa44f4d46ee (patch)
treecc1b9a45f4b1f8845c42180040044bc5c53b6c91
parent7b51850f6880c06498f89a1c42ef27d24e310c5f (diff)
parentf053296f9bcef5f2c52c980ff5bc6046d2dd383e (diff)
downloadrspamd-77ae701e0e023925e3399c2efc5a1aa44f4d46ee.tar.gz
rspamd-77ae701e0e023925e3399c2efc5a1aa44f4d46ee.zip
Merge pull request #2630 from citrin/unit-test-fedora-clang
Run unit test with clang sanitizers
-rw-r--r--.drone.yml27
1 files changed, 27 insertions, 0 deletions
diff --git a/.drone.yml b/.drone.yml
index a5855d5b0..2d01911ba 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -38,6 +38,8 @@ pipeline:
- test "$(id -un)" = nobody
- cd /rspamd/fedora/build
- export LDFLAGS='-fuse-ld=lld'
+ - export CFLAGS='-fsanitize=address,undefined,implicit-integer-truncation'
+ - export ASAN_OPTIONS=detect_leaks=0
- >
cmake
-DENABLE_CLANG_PLUGIN=ON
@@ -105,6 +107,31 @@ pipeline:
- luacov-coveralls -o /rspamd/build/unit_test_lua.json --dryrun
- exit $EXIT_CODE
+ test-fedora-clang:
+ # https://github.com/rspamd/rspamd-build-docker/blob/master/fedora-test/Dockerfile
+ image: rspamd/ci-fedora-test
+ pull: true
+ group: tests
+ commands:
+ - test "$(id -un)" = nobody
+ # Asan reserves 20Tb of virtual memory, limit core size to 2 Gb to avoid writing huge core
+ - ulimit -c 2097152
+ # disable leak sanitizer: too many leaks detected, most of them probably FP
+ - export ASAN_OPTIONS="detect_leaks=0:print_stacktrace=1:disable_coredump=0"
+ - export UBSAN_OPTIONS="print_stacktrace=1:print_summary=0:log_path=/tmp/ubsan"
+ - cd /rspamd/fedora/build/test
+ - set +e
+ - ./rspamd-test -p /rspamd/lua; EXIT_CODE=$?
+ - set -e
+ # shell sets exit status of a process terminated by a signal to '128 + signal-number'
+ # if rspamd-test was terminated by a signal it should be SIGSEGV or SIGABRT, try to examine core
+ - >
+ if [ $EXIT_CODE -gt 128 ]; then
+ gdb --batch -ex 'bt' -c /var/tmp/*.rspamd-test.core ./rspamd-test;
+ fi
+ - cat /tmp/ubsan.*
+ - exit $EXIT_CODE
+
functional:
# https://github.com/rspamd/rspamd-build-docker/blob/master/ubuntu-test-func/Dockerfile
image: rspamd/ci-ubuntu-test-func