2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-27 04:18:27 +00:00
criu/test/abrt.sh
Andrei Vagin 4fd8f39669 travis: catch core dump files in error cases
It is very hard to investigate travis fails, when something is segfaulted.

Let's add our own core file handler which will provide all required
information for us. Now test/abrt.sh shows a process tree,
process mappings, registers and backtraces.

v2: change a variable name
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Thanked-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-06 19:31:20 +03:00

31 lines
408 B
Bash
Executable File

#!/bin/bash -x
pid=$1
vpid=$2
sig=$3
comm=$4
exec &>> /tmp/zdtm-core.log
expr match "$comm" zombie00 && {
cat > /dev/null
exit 0
}
report="/tmp/zdtm-core-$pid-$comm"
exec &> ${report}.txt
ps axf
ps -p $pid
cat /proc/$pid/status
ls -l /proc/$pid/fd
cat /proc/$pid/maps
exec 33< /proc/$pid/exe
cat > $report.core
echo 'bt
i r
disassemble $rip-0x10,$rip + 0x10
' | gdb -c $report.core /proc/self/fd/33