]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Accept any core if no core with the "correct" pid can be found.
authorMark Wielaard <mark@klomp.org>
Fri, 16 Feb 2018 19:34:25 +0000 (20:34 +0100)
committerMark Wielaard <mark@klomp.org>
Fri, 16 Feb 2018 19:36:42 +0000 (20:36 +0100)
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 <mark@klomp.org>
tests/ChangeLog
tests/backtrace-subr.sh

index cfdd7f90978dcf3ee1be79ed3ee1e6be64787c49..9a89676aed4014f988d8cb2216c711d727ec6827 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-16  Mark Wielaard  <mark@klomp.org>
+
+       * backtrace-subr.sh (check_native_core): Check if there is any core,
+       if so, use it.
+
 2018-02-15  Mark Wielaard  <mark@klomp.org>
 
        * backtrace-child.c: Include signal.h after sys/ptrace.h.
index e04a7ea6e83ddbf711998d1f0bd30dcf5e114b78..ff42c6ffda26b414015d7fa0f4cfa07be64d30a5 100644 (file)
@@ -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;