ianlancetaylor / libbacktrace

A C library that may be linked into a C/C++ program to produce symbolic backtraces
Other
944 stars 220 forks source link

Test suite failures on macOS 12 #123

Open bhaible opened 3 months ago

bhaible commented 3 months ago

On a macOS 12.5 machine, building libbacktrace (current git HEAD) and running "make check" produces 7 test failures:

PASS: allocfail.sh
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
FAIL: btest
FAIL: btest_alloc
PASS: stest
PASS: stest_alloc
FAIL: edtest
FAIL: edtest_alloc
PASS: ttest
PASS: ttest_alloc
FAIL: dwarf5
FAIL: dwarf5_alloc
FAIL: mtest
============================================================================
Testsuite summary for package-unused version-unused
============================================================================
# TOTAL: 21
# PASS:  14
# SKIP:  0
# XFAIL: 0
# FAIL:  7
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
============================================================================

Here is the test-suite.log: test-suite.log.gz

It seems that the compiler and tooling don't support dwarf 5 well. When configured with libbacktrace_cv_lib_dwarf5=no ./configure, there are only 5 test failures:

PASS: allocfail.sh
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
FAIL: btest
FAIL: btest_alloc
PASS: stest
PASS: stest_alloc
FAIL: edtest
FAIL: edtest_alloc
PASS: ttest
PASS: ttest_alloc
FAIL: mtest
============================================================================
Testsuite summary for package-unused version-unused
============================================================================
# TOTAL: 19
# PASS:  14
# SKIP:  0
# XFAIL: 0
# FAIL:  5
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
============================================================================

To reproduce, you can use the cfarm104 machine of the GCC compile farm https://portal.cfarm.net/ . Alternatively, macOS 12 machines are also available through GitHub actions.

ianlancetaylor commented 2 months ago

Thanks. I think the non-DWARF5 failures are fixed now. On the machine I tested on, on the GCC compile farm, the DWARF5 failures appear to be due to bugs in the dsymutil program, which doesn't seem to understand DWARF5 yet. However, I don't know how to find out which version of macOS that machine is running. dsymutil -v reports

Apple LLVM version 14.0.0 (clang-1400.0.29.202)
  Optimized build.
  Default target: arm64-apple-darwin21.6.0
  Host CPU: apple-a12

Can you update to libbacktrace HEAD and see what testsuite failures you get now? Thanks.

bhaible commented 2 months ago

With current libbacktrace HEAD:

bhaible commented 2 months ago

Btw, the macOS version of that machine is

$ sw_vers 
ProductName:    macOS
ProductVersion: 12.6
BuildVersion:   21G115

(My statement that it was macOS 12.5 was incorrect. There is not a 1:1 mapping between Darwin versions and macOS versions. See https://en.wikipedia.org/wiki/MacOS_Monterey#Release_history )

ianlancetaylor commented 2 months ago

Hopefully Apple will fix dsymutil to support DWARF 5.