[PATCH 2/2] unwind: add libdw as a alternative unwinder back-end

Mark Wielaard mark at klomp.org
Wed Apr 11 10:00:13 UTC 2018


Hi,

On Wed, 2018-04-11 at 03:14 +0900, Masatake YAMATO wrote:
> On Tue, 10 Apr 2018 00:43:24 +0300, "Dmitry V. Levin" <ldv at altlinux.org> wrote:
> > Everything looks fine except on armv7 which seems to be universally broken
> > (neither libdw nor libunwind works in all distributions I tested).
> > For example, libdw-based unwinder fails strace-k.test with the following
> > diagnostics in rawhide scratch build:
> > getpid()                                = 31248
> >  > /usr/lib/libc-2.27.9000.so(__getpid+0xc) [0x9f66c]
> >  > No DWARF information found
>> > Surprisingly, aarch64 also fails in rawhide scratch build, but this might
> > be a rawhide specific issue as in other distributions strace-k.test passes
> > on aarch64.
>> > For the reference, the rawhide scratch build is
> > https://koji.fedoraproject.org/koji/taskinfo?taskID=26274471
> 
> How about install glibc-debuginfo package for the test environment?
> It seems that "No DWARF information found" on the architectures is expected.
> 
> I found following comment in elfutils/tests/backtrace-subr.sh:
> 
>     check_native_unsupported()
>     {
>       err=$1
>       testname=$2
>       check_unsupported $err $testname
> 
>       # ARM is special. It is supported, but it doesn't use .eh_frame by default
>       # making the native tests fail unless debuginfo (for glibc) is installed
>       # and we can fall back on .debug_frame for the CFI.
>       case "`uname -m`" in
>         arm* )
>           if egrep 'dwfl_thread_getframes(.*)No DWARF information found' $err; then
>            echo >&2 $testname: arm needs debuginfo installed for all libraries
>            exit 77
>           fi
>         ;;
>       esac
>     }
> 
> About the comment, "# ARM...", I found following commit log:
> 
>     commit 225dddfda38c1cd90e2daa3e72da2a9d01013336
> >     Author: Mark Wielaard <mjw at redhat.com>
>     Date:   Sun Jan 26 20:16:48 2014 +0100
> 
>         backends: Add arm frame_nregs and set_initial_registers_tid.
> 
>         This allows CFI unwinding for ARM. It relies on having .debug_frame around
>         which is always the case in our testsuite. All native backtrace tests PASS
>         on arm if debuginfo (for glibc) is installed on the system. Otherwise the
>         tests SKIP.
> 
>         For non-debug unwinding ARM uses EXIDX tables, not .eh_frames, which
>         would have to be translated to CFI to do unwinding without .debug_frame
>         available.
> 
> >         Signed-off-by: Mark Wielaard <mjw at redhat.com>
> 
> Mark, could you give us any hit or comment?

That commit message does summarize it nicely I think.
For arm32 elfutils libdw can unwind if it has the CFI, either through
.eh_frame or .debug_frame, but you have to install the later
explicitly. To get full unwind support on arm32 we would have to add
support for EXIDX tables. But nobody has written that support yet.

For aarch64 I just fixed an issue that seems to have been introduced
with GCC8 on Fedora 28. I have backported it to the Fedora elfutils
package for rawhide and f28. It should make unwinding work again on
that architecture.

https://sourceware.org/ml/elfutils-devel/2018-q2/msg00006.html
https://bodhi.fedoraproject.org/updates/FEDORA-2018-0be914ed2a

Cheers,

Mark


More information about the Strace-devel mailing list