comparison .travis.yml @ 22059:82bcf109c573 v8.2.1579

patch 8.2.1579: reports from asan are not optimal Commit: https://github.com/vim/vim/commit/5b5aa11801c75fac18a587bea02dc7a8b5b90c4b Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 3 16:05:04 2020 +0200 patch 8.2.1579: reports from asan are not optimal Problem: Reports from asan are not optimal. Solution: Use clang with ubsan. (James McCoy, closes https://github.com/vim/vim/issues/6811)
author Bram Moolenaar <Bram@vim.org>
date Thu, 03 Sep 2020 16:15:04 +0200
parents ef929329affe
children 8eed19bd0235
comparison
equal deleted inserted replaced
22058:bc8d10f64a2a 22059:82bcf109c573
1 language: c 1 language: c
2 2
3 env: 3 env:
4 global: 4 global:
5 - BUILD=yes TEST=test CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no 5 - BUILD=yes TEST=test CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no LOG_DIR="$TRAVIS_BUILD_DIR/logs"
6 6
7 _anchors: 7 _anchors:
8 envs: 8 envs:
9 - &tiny-nogui 9 - &tiny-nogui
10 FEATURES=tiny TEST=testtiny CONFOPT="--disable-gui" 10 FEATURES=tiny TEST=testtiny CONFOPT="--disable-gui"
23 - &unittests 23 - &unittests
24 BUILD=no TEST=unittests FEATURES=huge CHECK_AUTOCONF=yes 24 BUILD=no TEST=unittests FEATURES=huge CHECK_AUTOCONF=yes
25 - &coverage 25 - &coverage
26 CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage 26 CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage
27 - &asan # ASAN build 27 - &asan # ASAN build
28 SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer" 28 SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
29 ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt" 29 ASAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/asan" UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt"
30 - &shadowopt 30 - &shadowopt
31 SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow 31 SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow
32 32
33 linux: &linux 33 linux: &linux
34 os: linux 34 os: linux
35 dist: bionic 35 dist: bionic
36 addons: 36 addons:
37 apt: 37 apt:
38 packages: 38 packages: &apt-packages
39 - autoconf 39 - autoconf
40 - clang 40 - clang
41 - lcov 41 - lcov
42 - gettext 42 - gettext
43 - libcanberra-dev 43 - libcanberra-dev
106 106
107 asan_symbolize: &asan_symbolize 107 asan_symbolize: &asan_symbolize
108 # Update pyenv to fix the error "/opt/pyenv/libexec/pyenv: line 43: cd: asan_symbolize-6.0: Not a directory". 108 # Update pyenv to fix the error "/opt/pyenv/libexec/pyenv: line 43: cd: asan_symbolize-6.0: Not a directory".
109 # https://github.com/pyenv/pyenv/issues/580 109 # https://github.com/pyenv/pyenv/issues/580
110 - (cd "${PYENV_ROOT}" && git fetch -p origin && git checkout "$(git rev-list --tags -n1)") &>/dev/null || true 110 - (cd "${PYENV_ROOT}" && git fetch -p origin && git checkout "$(git rev-list --tags -n1)") &>/dev/null || true
111 - find . -type f -name 'asan.*' -size +0 2>/dev/null | xargs grep -l '^==[[:digit:]]*==ERROR:' | xargs -I{} -n1 -t asan_symbolize -l{} 111 - for f in $(grep -l '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "$LOG_DIR"/*); do asan_symbolize-11 -l "$f"; done
112 112
113 branches: 113 branches:
114 except: 114 except:
115 - /^v[0-9]/ 115 - /^v[0-9]/
116 116
117 script: 117 script:
118 - mkdir -p "$LOG_DIR"
118 - NPROC=$(getconf _NPROCESSORS_ONLN) 119 - NPROC=$(getconf _NPROCESSORS_ONLN)
119 - set -o errexit 120 - set -o errexit
120 - echo -e "\\033[33;1mConfiguring Vim\\033[0m" && echo -en "travis_fold:start:configure\\r\\033[0K" 121 - echo -e "\\033[33;1mConfiguring Vim\\033[0m" && echo -en "travis_fold:start:configure\\r\\033[0K"
121 - | 122 - |
122 if [[ "${CHECK_AUTOCONF}" = "yes" ]] && [[ "${CC}" = "gcc" ]]; then 123 if [[ "${CHECK_AUTOCONF}" = "yes" ]] && [[ "${CC}" = "gcc" ]]; then
133 - | 134 - |
134 if [[ "${BUILD}" = "yes" ]]; then 135 if [[ "${BUILD}" = "yes" ]]; then
135 # Append various warning flags to CFLAGS. 136 # Append various warning flags to CFLAGS.
136 # BSD sed needs backup extension specified. 137 # BSD sed needs backup extension specified.
137 sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk 138 sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
138 if [[ "${TRAVIS_OS_NAME}" = "osx" ]]; then 139 if [[ "${TRAVIS_OS_NAME}" = "osx" ]] || [[ "${CC}" = "clang-11" ]]; then
139 # On macOS, the entity of gcc is clang. 140 # On macOS, the entity of gcc is clang.
140 sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk 141 sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
141 else 142 else
142 sed -i.bak -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk 143 sed -i.bak -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk
143 fi 144 fi
153 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit 154 "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
154 fi 155 fi
155 - echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K" 156 - echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K"
156 - do_test make ${SHADOWOPT} ${TEST} && FOLD_MARKER=travis_fold 157 - do_test make ${SHADOWOPT} ${TEST} && FOLD_MARKER=travis_fold
157 - echo -en "${FOLD_MARKER}:end:test\\r\\033[0K" 158 - echo -en "${FOLD_MARKER}:end:test\\r\\033[0K"
159 - |
160 # Not all sanitizers will cause the tests to fail. This helps since we can
161 # see all the failures instead of just the first one, but we still want the
162 # test phase to fail if any sanitizer issues are detected.
163 if [[ -n "${ASAN_OPTIONS}" ]]; then
164 if grep -q '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "$LOG_DIR"/*; then
165 false
166 fi
167 fi
158 168
159 # Instead of using all environments with both compilers on both systems, 169 # Instead of using all environments with both compilers on both systems,
160 # exclude some builds on mac os x and linux. 170 # exclude some builds on mac os x and linux.
161 # On mac os x "tiny" is always without GUI, use 2 compilers in 2 environments. 171 # On mac os x "tiny" is always without GUI, use 2 compilers in 2 environments.
162 # Linux: 2 compilers on some of the environments + gcc on os390 172 # Linux: 2 compilers on some of the environments + gcc on os390
239 env: 249 env:
240 - *linux-huge 250 - *linux-huge
241 - *coverage 251 - *coverage
242 after_success: *eval-coverage 252 after_success: *eval-coverage
243 - <<: *linux # ASAN 253 - <<: *linux # ASAN
244 name: huge+asan/gcc 254 name: huge+asan/clang
245 compiler: gcc 255 compiler: clang-11
256 addons:
257 apt:
258 sources:
259 - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'
260 key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
261 packages:
262 - *apt-packages
263 - clang-11
246 env: 264 env:
247 - *linux-huge 265 - *linux-huge
248 - *asan 266 - *asan
249 after_failure: *asan_symbolize 267 after_failure: *asan_symbolize
250 - <<: *linux 268 - <<: *linux