libbacktrace icon indicating copy to clipboard operation
libbacktrace copied to clipboard

Tests suite failure on OpenBSD/amd64

Open lcheylus opened this issue 1 year ago • 2 comments

On OpenBSD current/amd64 (future version 7.6, release planned end of October 2024), I succeeded to build libbacktrace with Clang v16 and GCC 11.

But I have some errors (9 fail for 38 tests) during run of tests suite (gmake is GNU Make on OpenBSD):

$ gmake check
(...)
gmake  check-TESTS
gmake[1]: Entering directory '/home/fox/dev/libbacktrace.git'
gmake[2]: Entering directory '/home/fox/dev/libbacktrace.git'
PASS: allocfail.sh
./install-debuginfo-for-buildid.sh \
  "/home/fox/dev/libbacktrace.git/usr/lib/debug/.build-id/" \
  b2test
objcopy --strip-debug b2test b2test_buildid
FAIL: b2test_buildid
./install-debuginfo-for-buildid.sh \
  "/home/fox/dev/libbacktrace.git/usr/lib/debug/.build-id/" \
  b2test
objcopy --strip-all b2test b2test_buildidfull
FAIL: b2test_buildidfull
rm -f b3test_dwz b3test_dwz_common.debug
cp b3test b3test_dwz_1
cp b3test b3test_dwz_2
if dwz -m b3test_dwz_common.debug b3test_dwz_1 b3test_dwz_2; then \
  rm -f b3test_dwz_2; \
  mv b3test_dwz_1 b3test_dwz; \
else \
  echo "Ignoring dwz errors, assuming that test passes"; \
  cp b3test b3test_dwz; \
fi
./install-debuginfo-for-buildid.sh \
  "/home/fox/dev/libbacktrace.git/usr/lib/debug/.build-id/" \
  b3test_dwz
objcopy --strip-debug b3test_dwz b3test_dwz_buildid
FAIL: b3test_dwz_buildid
./install-debuginfo-for-buildid.sh \
  "/home/fox/dev/libbacktrace.git/usr/lib/debug/.build-id/" \
  b3test_dwz
objcopy --strip-all b3test_dwz b3test_dwz_buildidfull
FAIL: b3test_dwz_buildidfull
rm -f btest_dwz btest_dwz_common.debug
cp btest btest_dwz_1
cp btest btest_dwz_2
if dwz -m btest_dwz_common.debug btest_dwz_1 btest_dwz_2; then \
  rm -f btest_dwz_2; \
  mv btest_dwz_1 btest_dwz; \
else \
  echo "Ignoring dwz errors, assuming that test passes"; \
  cp btest btest_dwz; \
fi
PASS: btest_dwz
objcopy --only-keep-debug btest_dwz btest_dwz_gnudebuglink.debug
objcopy --strip-debug --add-gnu-debuglink=btest_dwz_gnudebuglink.debug btest_dwz btest_dwz_gnudebuglink
FAIL: btest_dwz_gnudebuglink
objcopy --only-keep-debug btest btest_gnudebuglink.debug
objcopy --strip-debug --add-gnu-debuglink=btest_gnudebuglink.debug btest btest_gnudebuglink
FAIL: btest_gnudebuglink
objcopy --only-keep-debug btest btest_gnudebuglinkfull.debug
objcopy --strip-all --add-gnu-debuglink=btest_gnudebuglinkfull.debug btest btest_gnudebuglinkfull
FAIL: btest_gnudebuglinkfull
/usr/bin/nm -D mtest -P --defined-only | awk '{ print $1 }' | sort > mtest.dsyms
nm: unknown option -- defined-only
usage: nm [-AaCDegnoPprsuw] [-t d|o|x] [file ...]
/usr/bin/nm mtest -P --defined-only | awk '{ if ($2 == "T" || $2 == "t" || $2 == "D") print $1 }' | sort > mtest.fsyms
nm: unknown option -- defined-only
usage: nm [-AaCDegnoPprsuw] [-t d|o|x] [file ...]
comm -13 mtest.dsyms mtest.fsyms > mtest.keepsyms
objcopy --only-keep-debug mtest mtest.dbg
objcopy -S --remove-section .gdb_index --remove-section .comment --keep-symbols=mtest.keepsyms mtest.dbg mtest.mdbg
objcopy --strip-all --remove-section ..comment mtest mtest.strip
rm -f mtest.mdbg.xz
xz mtest.mdbg
objcopy --add-section .gnu_debugdata=mtest.mdbg.xz mtest.strip
mv mtest.strip mtest_minidebug
FAIL: mtest_minidebug
/usr/bin/nm -D m2test -P --defined-only | awk '{ print $1 }' | sort > m2test.dsyms2
nm: unknown option -- defined-only
usage: nm [-AaCDegnoPprsuw] [-t d|o|x] [file ...]
/usr/bin/nm m2test -P --defined-only | awk '{ if ($2 == "T" || $2 == "t" || $2 == "D") print $1 }' | sort > m2test.fsyms2
nm: unknown option -- defined-only
usage: nm [-AaCDegnoPprsuw] [-t d|o|x] [file ...]
comm -13 m2test.dsyms2 m2test.fsyms2 > m2test.keepsyms2
objcopy --only-keep-debug m2test m2test.dbg2
objcopy -S --remove-section .gdb_index --remove-section .comment --keep-symbols=m2test.keepsyms2 m2test.dbg2 m2test.mdbg2
objcopy --strip-all --remove-section ..comment m2test m2test.strip2
rm -f m2test.mdbg2.xz
xz m2test.mdbg2
objcopy --add-section .gnu_debugdata=m2test.mdbg2.xz m2test.dbg2
objcopy --add-section .gnu_debugdata=m2test.mdbg2.xz m2test.strip2
/bin/sh ./install-debuginfo-for-buildid.sh /home/fox/dev/libbacktrace.git/usr/lib/debug/.build-id/ m2test.dbg2
readelf: Warning: corrupt note found at offset 18 into core notes
readelf: Warning:  type: dfdfdf00, namesize: 00000000, descsize: 00000000
mv m2test.strip2 m2test_minidebug2
FAIL: m2test_minidebug2
FAIL: m2test_minidebug2
PASS: test_elf_32
PASS: test_elf_64
PASS: test_macho
PASS: test_xcoff_32
PASS: test_xcoff_64
PASS: test_pecoff
PASS: test_unknown
PASS: unittest
PASS: unittest_alloc
PASS: btest
PASS: btest_lto
PASS: btest_alloc
PASS: stest
PASS: stest_alloc
PASS: ztest
PASS: ztest_alloc
PASS: zstdtest
PASS: zstdtest_alloc
PASS: edtest
PASS: edtest_alloc
PASS: ttest
PASS: ttest_alloc
PASS: dwarf5
PASS: dwarf5_alloc
PASS: mtest
PASS: xztest
PASS: xztest_alloc
============================================================================
Testsuite summary for package-unused version-unused
============================================================================
# TOTAL: 38
# PASS:  29
# SKIP:  0
# XFAIL: 0
# FAIL:  9
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
============================================================================

Content of test-suite.log: test-suite.log

Have you any clue to debug and fix these errors?

lcheylus avatar Sep 24 '24 16:09 lcheylus

There are some errors with usage of nm: nm: unknown option -- defined-only => this option (-- defined-only or -U) is not avaiable for nm on OpenBSD => see manpage https://man.openbsd.org/nm

lcheylus avatar Sep 24 '24 16:09 lcheylus

Replacing OpenBSD version of nm, objdump and objcopy by GNU ones (installing binutils OpenBSD package for these GNU tools), I have only 4 errors left (/38):

$ gmake check
(...)
FAIL: b2test_buildid
FAIL: b2test_buildidfull
FAIL: b3test_dwz_buildid
FAIL: b3test_dwz_buildidfull

Content of test-suite.log for full debug:

=====================================================
   package-unused version-unused: ./test-suite.log
=====================================================

# TOTAL: 38
# PASS:  34
# SKIP:  0
# XFAIL: 0
# FAIL:  4
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: b2test_buildid
====================

test1: [0]: missing file name or function name
test2: [0]: missing file name or function name
test3: [0]: missing file name or function name
test4: [0]: missing file name or function name
FAIL: backtrace_full noinline
FAIL: backtrace_full inline
FAIL: backtrace_simple noinline
FAIL: backtrace_simple inline
PASS: backtrace_syminfo variable
FAIL b2test_buildid (exit status: 1)

FAIL: b2test_buildidfull
========================

test1: [0]: missing file name or function name
test2: [0]: missing file name or function name
test3: [0]: missing file name or function name
test3: [0]: NULL syminfo name
test3: [1]: NULL syminfo name
test3: [2]: NULL syminfo name
test4: [0]: missing file name or function name
test5: NULL syminfo name
FAIL: backtrace_full noinline
FAIL: backtrace_full inline
FAIL: backtrace_simple noinline
FAIL: backtrace_simple inline
FAIL: backtrace_syminfo variable
FAIL b2test_buildidfull (exit status: 1)

FAIL: b3test_dwz_buildid
========================

test1: [0]: missing file name or function name
test2: [0]: missing file name or function name
test3: [0]: missing file name or function name
test4: [0]: missing file name or function name
FAIL: backtrace_full noinline
FAIL: backtrace_full inline
FAIL: backtrace_simple noinline
FAIL: backtrace_simple inline
PASS: backtrace_syminfo variable
FAIL b3test_dwz_buildid (exit status: 1)

FAIL: b3test_dwz_buildidfull
============================

test1: [0]: missing file name or function name
test2: [0]: missing file name or function name
test3: [0]: missing file name or function name
test3: [0]: NULL syminfo name
test3: [1]: NULL syminfo name
test3: [2]: NULL syminfo name
test4: [0]: missing file name or function name
test5: NULL syminfo name
FAIL: backtrace_full noinline
FAIL: backtrace_full inline
FAIL: backtrace_simple noinline
FAIL: backtrace_simple inline
FAIL: backtrace_syminfo variable
FAIL b3test_dwz_buildidfull (exit status: 1)

lcheylus avatar Sep 24 '24 17:09 lcheylus