diff --git a/.travis.yml b/.travis.yml index d6b3b1d6b..9a82a2b7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,6 +73,7 @@ before_install: install: - bash scripts/dev/ci/travis_install.sh + - ulimit -c unlimited script: - bash scripts/dev/ci/travis_run.sh @@ -80,6 +81,9 @@ script: after_success: - '[[ $TESTENV == *-cov ]] && codecov -e TESTENV -X gcov' +after_failure: + - bash scripts/dev/ci/travis_backtrace.sh + notifications: webhooks: - https://buildtimetrend.herokuapp.com/travis diff --git a/scripts/dev/ci/travis_backtrace.sh b/scripts/dev/ci/travis_backtrace.sh new file mode 100644 index 000000000..80b79c220 --- /dev/null +++ b/scripts/dev/ci/travis_backtrace.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Find all possible core files under current directory. Attempt +# to determine exe using file(1) and dump stack trace with gdb. +# +say () { printf "\033[91m%s\033[39m\n" "$@" >&2; } +die () { say "$@"; exit 1; } + +find . -name *.core -o -name core | while read -r line; do + d=$(dirname $line) + f=$(basename $line) + exe=$(file $line | sed "s/.*from '\([^ \t]*\).*'.*/\1/") + ( cd $d && + test -x $exe || die "Failed to find executable at $exe" && + say "Found corefile for $exe" && + gdb --batch --quiet -ex "thread apply all bt full" $exe $f + ) +done diff --git a/scripts/dev/ci/travis_install.sh b/scripts/dev/ci/travis_install.sh index 4fd5d6327..59a6306a5 100644 --- a/scripts/dev/ci/travis_install.sh +++ b/scripts/dev/ci/travis_install.sh @@ -113,11 +113,11 @@ tox --version case $TESTENV in py34-cov) pip_install -r misc/requirements/requirements-codecov.txt - apt_install xvfb $pyqt_pkgs libpython3.4-dev + apt_install xvfb $pyqt_pkgs libpython3.4-dev gdb apport check_pyqt ;; py3*-pyqt*) - apt_install xvfb geoclue + apt_install xvfb geoclue gdb apport ;; pylint|vulture) apt_install $pyqt_pkgs libpython3.4-dev