From: Mark Wielaard Date: Fri, 16 Feb 2018 19:34:25 +0000 (+0100) Subject: tests: Accept any core if no core with the "correct" pid can be found. X-Git-Tag: elfutils-0.171~78 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61e33d72788c58467668b2f2ad44d5b95ebbee80;p=thirdparty%2Felfutils.git tests: Accept any core if no core with the "correct" pid can be found. In some containers our view of pids is confused. We see the container pid namespace, but the core is generated using the host pid namespace. Since tests are run in a new fresh directory any core here is most like is ours. Signed-off-by: Mark Wielaard --- diff --git a/tests/ChangeLog b/tests/ChangeLog index cfdd7f909..9a89676ae 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2018-02-16 Mark Wielaard + + * backtrace-subr.sh (check_native_core): Check if there is any core, + if so, use it. + 2018-02-15 Mark Wielaard * backtrace-child.c: Include signal.h after sys/ptrace.h. diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh index e04a7ea6e..ff42c6ffd 100644 --- a/tests/backtrace-subr.sh +++ b/tests/backtrace-subr.sh @@ -173,6 +173,13 @@ check_native_core() coredumpctl --output="$core" dump $pid || rm -f $core fi fi + if [ ! -f "$core" ]; then + # In some containers our view of pids is confused. Since tests are + # run in a new fresh directory any core here is most like is ours. + if ls core.[0-9]* 1> /dev/null 2>&1; then + mv core.[0-9]* "$core" + fi + fi if [ ! -f "$core" ]; then echo "No $core file generated"; exit 77;