tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: libunwind on arm



On Thu, Nov 28, 2019 at 01:36:16PM +0100, Martin Husemann wrote:
> On Thu, Nov 28, 2019 at 01:26:20PM +0100, Manuel Bouyer wrote:
> > Hello,
> > it seems that we have our own implementation of libunwind in
> > src/sys/lib/libunwind/
> > Has it been tested on arm (earmv7hf if that matters) ?
> > I'm trying to get stack trace working in gperftools; it works on
> > x86_64 but not earmv7hf. Some comments in the commit log could suggest
> > that there are missing bits for earm ?
> 
> AFAICT it works:
> 
>  cd /usr/tests/lib/libexecinfo && atf-run|atf-report
> 
> Tests root: /usr/tests/lib/libexecinfo
> 
> t_backtrace (1/1): 1 test cases
>     backtrace_fmt_basic: [0.028707s] Passed.
> [0.030101s]

thanks.
With gperftools-2.7nb3, I get segfaults in the unit tests
(make test in devel/gperftools). using libprofiler.so I don't see the
segfault but there's no call graph.

Here's an example:
Reading symbols from stacktrace_unittest...
[New process 1]
Core was generated by `stacktrace_unitt'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x6668efd8 in _Unwind::LocalAddressSpace::get32 (this=0x666e743c, 
    addr=4294967256) at /usr/src/sys/lib/libunwind/AddressSpace.hpp:85
85      /usr/src/sys/lib/libunwind/AddressSpace.hpp: No such file or directory.
(gdb) 

(4294967256 is 0xffffffd8).
#0  0x6668efd8 in _Unwind::LocalAddressSpace::get32 (this=0x666e743c, 
    addr=4294967256) at /usr/src/sys/lib/libunwind/AddressSpace.hpp:85
#1  _Unwind::LocalAddressSpace::getP (this=0x666e743c, addr=4294967256)
    at /usr/src/sys/lib/libunwind/AddressSpace.hpp:97
#2  _Unwind::DwarfInstructions<_Unwind::LocalAddressSpace, _Unwind::Registers_arm32>::getSavedRegister (addressSpace=..., registers=..., cfa=cfa@entry=4, 
    savedReg=...) at /usr/src/sys/lib/libunwind/DwarfInstructions.hpp:72
#3  0x6668f240 in _Unwind::DwarfInstructions<_Unwind::LocalAddressSpace, _Unwind::Registers_arm32>::stepWithDwarf (addressSpace=..., pc=<optimized out>, 
    fdeStart=<optimized out>, registers=..., ctx=ctx@entry=0x7fe7a470)
    at /usr/src/sys/lib/libunwind/DwarfInstructions.hpp:143
#4  0x665ab590 in _Unwind::UnwindCursor<_Unwind::LocalAddressSpace, _Unwind::Registers_arm32>::stepWithDwarfFDE (this=0x7fe7a470)
    at /usr/src/sys/lib/libunwind/UnwindCursor.hpp:84
#5  _Unwind::UnwindCursor<_Unwind::LocalAddressSpace, _Unwind::Registers_arm32>::step (this=0x7fe7a470) at /usr/src/sys/lib/libunwind/UnwindCursor.hpp:55
#6  _Unwind_Backtrace (
    callback=0x11f58 <libgcc_backtrace_helper(_Unwind_Context*, void*)>, 
    ref=0x7fe7a618) at /usr/src/sys/lib/libunwind/libunwind.cxx:310
#7  0x00012060 in GetStackTrace_libgcc (result=0x7fe7a688, max_depth=10, 
    skip_count=0) at src/stacktrace_libgcc-inl.h:100
#8  0x00012980 in GetStackTrace (result=0x7fe7a688, max_depth=10, skip_count=0)
    at src/stacktrace.cc:295
#9  0x00011254 in (anonymous namespace)::CheckStackTraceLeaf ()
    at src/tests/stacktrace_unittest.cc:118
#10 0x000115c4 in (anonymous namespace)::CheckStackTrace4 (i=0)
    at src/tests/stacktrace_unittest.cc:152
#11 0x00011740 in (anonymous namespace)::CheckStackTrace3 (i=0)
    at src/tests/stacktrace_unittest.cc:160
#12 0x000118bc in (anonymous namespace)::CheckStackTrace2 (i=0)
    at src/tests/stacktrace_unittest.cc:168
#13 0x00011a38 in (anonymous namespace)::CheckStackTrace1 (i=0)
    at src/tests/stacktrace_unittest.cc:176
#14 0x00011b00 in (anonymous namespace)::CheckStackTrace (i=0)
    at src/tests/stacktrace_unittest.cc:183
#15 0x00011b48 in main (argc=1, argv=0x7fe7a7c4)
    at src/tests/stacktrace_unittest.cc:191

Eventually I'll try to debug, but I don't really know what I'm doing in this
area ...

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index