mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
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 #6811)
This commit is contained in:
parent
62f93f4ec9
commit
5b5aa11801
34
.travis.yml
34
.travis.yml
@ -2,7 +2,7 @@ language: c
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- BUILD=yes TEST=test CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
|
- BUILD=yes TEST=test CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no LOG_DIR="$TRAVIS_BUILD_DIR/logs"
|
||||||
|
|
||||||
_anchors:
|
_anchors:
|
||||||
envs:
|
envs:
|
||||||
@ -25,8 +25,8 @@ _anchors:
|
|||||||
- &coverage
|
- &coverage
|
||||||
CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage
|
CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage
|
||||||
- &asan # ASAN build
|
- &asan # ASAN build
|
||||||
SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer"
|
SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
|
||||||
ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt"
|
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"
|
||||||
- &shadowopt
|
- &shadowopt
|
||||||
SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow
|
SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ _anchors:
|
|||||||
dist: bionic
|
dist: bionic
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages: &apt-packages
|
||||||
- autoconf
|
- autoconf
|
||||||
- clang
|
- clang
|
||||||
- lcov
|
- lcov
|
||||||
@ -108,13 +108,14 @@ _anchors:
|
|||||||
# Update pyenv to fix the error "/opt/pyenv/libexec/pyenv: line 43: cd: asan_symbolize-6.0: Not a directory".
|
# Update pyenv to fix the error "/opt/pyenv/libexec/pyenv: line 43: cd: asan_symbolize-6.0: Not a directory".
|
||||||
# https://github.com/pyenv/pyenv/issues/580
|
# https://github.com/pyenv/pyenv/issues/580
|
||||||
- (cd "${PYENV_ROOT}" && git fetch -p origin && git checkout "$(git rev-list --tags -n1)") &>/dev/null || true
|
- (cd "${PYENV_ROOT}" && git fetch -p origin && git checkout "$(git rev-list --tags -n1)") &>/dev/null || true
|
||||||
- find . -type f -name 'asan.*' -size +0 2>/dev/null | xargs grep -l '^==[[:digit:]]*==ERROR:' | xargs -I{} -n1 -t asan_symbolize -l{}
|
- for f in $(grep -l '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "$LOG_DIR"/*); do asan_symbolize-11 -l "$f"; done
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
except:
|
except:
|
||||||
- /^v[0-9]/
|
- /^v[0-9]/
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
- mkdir -p "$LOG_DIR"
|
||||||
- NPROC=$(getconf _NPROCESSORS_ONLN)
|
- NPROC=$(getconf _NPROCESSORS_ONLN)
|
||||||
- set -o errexit
|
- set -o errexit
|
||||||
- echo -e "\\033[33;1mConfiguring Vim\\033[0m" && echo -en "travis_fold:start:configure\\r\\033[0K"
|
- echo -e "\\033[33;1mConfiguring Vim\\033[0m" && echo -en "travis_fold:start:configure\\r\\033[0K"
|
||||||
@ -135,7 +136,7 @@ script:
|
|||||||
# Append various warning flags to CFLAGS.
|
# Append various warning flags to CFLAGS.
|
||||||
# BSD sed needs backup extension specified.
|
# BSD sed needs backup extension specified.
|
||||||
sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
|
sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
|
||||||
if [[ "${TRAVIS_OS_NAME}" = "osx" ]]; then
|
if [[ "${TRAVIS_OS_NAME}" = "osx" ]] || [[ "${CC}" = "clang-11" ]]; then
|
||||||
# On macOS, the entity of gcc is clang.
|
# On macOS, the entity of gcc is clang.
|
||||||
sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
|
sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
|
||||||
else
|
else
|
||||||
@ -155,6 +156,15 @@ script:
|
|||||||
- echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K"
|
- echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K"
|
||||||
- do_test make ${SHADOWOPT} ${TEST} && FOLD_MARKER=travis_fold
|
- do_test make ${SHADOWOPT} ${TEST} && FOLD_MARKER=travis_fold
|
||||||
- echo -en "${FOLD_MARKER}:end:test\\r\\033[0K"
|
- echo -en "${FOLD_MARKER}:end:test\\r\\033[0K"
|
||||||
|
- |
|
||||||
|
# Not all sanitizers will cause the tests to fail. This helps since we can
|
||||||
|
# see all the failures instead of just the first one, but we still want the
|
||||||
|
# test phase to fail if any sanitizer issues are detected.
|
||||||
|
if [[ -n "${ASAN_OPTIONS}" ]]; then
|
||||||
|
if grep -q '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "$LOG_DIR"/*; then
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Instead of using all environments with both compilers on both systems,
|
# Instead of using all environments with both compilers on both systems,
|
||||||
# exclude some builds on mac os x and linux.
|
# exclude some builds on mac os x and linux.
|
||||||
@ -241,8 +251,16 @@ jobs:
|
|||||||
- *coverage
|
- *coverage
|
||||||
after_success: *eval-coverage
|
after_success: *eval-coverage
|
||||||
- <<: *linux # ASAN
|
- <<: *linux # ASAN
|
||||||
name: huge+asan/gcc
|
name: huge+asan/clang
|
||||||
compiler: gcc
|
compiler: clang-11
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'
|
||||||
|
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||||
|
packages:
|
||||||
|
- *apt-packages
|
||||||
|
- clang-11
|
||||||
env:
|
env:
|
||||||
- *linux-huge
|
- *linux-huge
|
||||||
- *asan
|
- *asan
|
||||||
|
@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1579,
|
||||||
/**/
|
/**/
|
||||||
1578,
|
1578,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user