On Wed, Sep 16, 2020 at 8:54 AM Alex Coplan wrote: > > On 16/09/2020 07:26, Ian Lance Taylor wrote: > > On Wed, Sep 16, 2020, 4:03 AM Alex Coplan wrote: > > > > > Hi Ian, > > > > > > On 14/09/2020 14:12, Ian Lance Taylor via Gcc-patches wrote: > > > > This patch to libbacktrace adds support for MiniDebugInfo, as > > > > requested in PR 93608. > > > > > > This appears to introduce a failure in the libbacktrace testsuite > > > (observed on both x86 and aarch64): > > > > > > ../gcc/libbacktrace/../test-driver: line 107: 7905 Segmentation fault > > > (core dumped) "$@" > $log_file 2>&1 > > > FAIL: mtest_minidebug > > > > > > > > I tested on x86 without seeing anything like this. Can you give me any > > more details? Thanks. > > Sure. On an Ubuntu 18.04 / x86-64 system with current trunk, configuring > with: > > ~/toolchain/src/gcc/configure \ > --prefix=`pwd` \ > --enable-languages=c,c++ \ > --disable-multilib \ > --disable-bootstrap > > running `make && make check-libbacktrace` gives the failure described > above. Here is the contents of libbacktrace/test-suite.log: > > ===================================================== > package-unused version-unused: ./test-suite.log > ===================================================== > > # TOTAL: 33 > # PASS: 32 > # SKIP: 0 > # XFAIL: 0 > # FAIL: 1 > # XPASS: 0 > # ERROR: 0 > > .. contents:: :depth: 2 > > FAIL: mtest_minidebug > ===================== > > no debug info in ELF executable > no debug info in ELF executable > no debug info in ELF executable > no debug info in ELF executable > no debug info in ELF executable > no debug info in ELF executable > no debug info in ELF executable > test1: not enough frames; got 0, expected at least 3 > test1: [0]: got expected f3 > test1: [1]: got expected f2 > FAIL mtest_minidebug (exit status: 139) > > --- > > Let me know if you need any more info. Thanks. I think the problem arises when libbacktrace is unable to find debug info for any shared library involved in the link. This patch should fix it. Bootstrapped and ran libbacktrace tests on x86_64-pc-linux-gnu and aarch64-linux-gnu. Committed to mainline. Ian PR libbacktrace/97080 * fileline.c (backtrace_syminfo_to_full_callback): New function. (backtrace_syminfo_to_full_error_callback): New function. * elf.c (elf_nodebug): Call syminfo_fn if possible. * internal.h (struct backtrace_call_full): Define. (backtrace_syminfo_to_full_callback): Declare. (backtrace_syminfo_to_full_error_callback): Declare. * mtest.c (f3): Only check all[i] if data.index permits.