]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix system test backtrace generation on OpenBSD
authorMichal Nowak <mnowak@isc.org>
Mon, 19 Oct 2020 11:33:32 +0000 (13:33 +0200)
committerMichal Nowak <mnowak@isc.org>
Mon, 26 Oct 2020 13:58:15 +0000 (14:58 +0100)
On Linux core dump contains absolute path to crashed binary

    Core was generated by `/home/newman/isc/ws/bind9/bin/named/.libs/lt-named -D glue-ns1 -X named.lock -m'.

However, on OpenBSD there's only a basename

    Core was generated by `named'.

This commit adds support for the latter, retains the former.

bin/tests/system/run.sh.in

index 2ab8bb91e76b33540fcf1ff0b09ae6004c1f93e3..c00d73466b879ce533e1f51bba8fe3a08e8b20ea 100644 (file)
@@ -265,7 +265,10 @@ if [ -n "$core_dumps" ]; then
         export SYSTESTDIR="$systest"
         echoinfo "D:$systest:backtrace from $coredump:"
         echoinfo "D:$systest:--------------------------------------------------------------------------------"
-        binary=$(gdb --batch --core="$coredump" 2>/dev/null | sed -ne "s/Core was generated by \`//;s/ .*'.$//p;")
+        binary=$(gdb --batch --core="$coredump" 2>/dev/null | sed -ne "s|Core was generated by \`\([^' ]*\)[' ].*|\1|p")
+        if [ ! -f "${binary}" ]; then
+            binary=$(find "${top_builddir}" -path "*/.libs/${binary}" -type f)
+        fi
         "${top_builddir}/libtool" --mode=execute gdb \
                                   -batch \
                                   -ex bt \