@@ -3,6 +3,10 @@ sudo: required
33dist : trusty
44services :
55 - docker
6+ addons :
7+ apt :
8+ packages :
9+ - gdb
610
711git :
812 depth : 2
@@ -249,6 +253,8 @@ before_script:
249253 export RUN_SCRIPT="$RUN_SCRIPT && src/ci/run.sh";
250254 else
251255 export RUN_SCRIPT="$RUN_SCRIPT && src/ci/docker/run.sh $IMAGE";
256+ # Enable core dump on Linux.
257+ sudo sh -c 'echo "/checkout/obj/cores/core.%p.%E" > /proc/sys/kernel/core_pattern';
252258 fi
253259
254260# Log time information from this machine and an external machine for insight into possible
@@ -274,6 +280,8 @@ after_failure:
274280
275281 # Random attempt at debugging currently. Just poking around in here to see if
276282 # anything shows up.
283+
284+ # Dump backtrace for macOS
277285 - ls -lat $HOME/Library/Logs/DiagnosticReports/
278286 - find $HOME/Library/Logs/DiagnosticReports
279287 -type f
@@ -284,8 +292,24 @@ after_failure:
284292 -exec head -750 {} \;
285293 -exec echo travis_fold":"end:crashlog \; || true
286294
295+ # Dump backtrace for Linux
296+ - ln -s . checkout &&
297+ for CORE in obj/cores/core.*; do
298+ EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|');
299+ if [ -f "$EXE" ]; then
300+ printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE";
301+ gdb -q -c "$CORE" "$EXE"
302+ -iex 'set auto-load off'
303+ -iex 'dir src/'
304+ -iex 'set sysroot .'
305+ -ex bt
306+ -ex q;
307+ echo travis_fold":"end:crashlog;
308+ fi;
309+ done || true
310+
287311 # see #50887
288- - head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
312+ - cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
289313
290314 # attempt to debug anything killed by the oom killer on linux, just to see if
291315 # it happened
0 commit comments