HeapTrack Query - Stripped Binary

Milian Wolff mail at milianw.de
Mon Jun 19 09:38:30 BST 2023


On Freitag, 16. Juni 2023 14:35:26 CEST sindhu krishnan wrote:
> Thank you!
> 
> I have updated libunwind to version 1.6.2 and heaptrack to version 1.4.0.
> 
> Initially, I believed that there might be an issue with unwinding the
> backtrace due to using a stripped binary.
> However, I just did LD_PRELOAD of libheaptrack_preload.so to my program.
> 
> 1) I am still experiencing a crash in libunwind.
> (gdb) bt
> #0  _ULarm_step (cursor=cursor at entry=0xbe964488) at
> ../../libunwind-1.6.2/src/arm/Gstep.c:173
> #1  0xb6d1b04c in slow_backtrace (uc=0xbe960448, size=64,
> buffer=0xbe9684b8) at ../../libunwind-1.6.2/src/mi/backtrace.c:45
> #2  unw_backtrace (buffer=buffer at entry=0xbe9684b8, size=size at entry=64)
> at ../../libunwind-1.6.2/src/mi/backtrace.c:72
> #3  0xb6fa4af0 in Trace::unwind (data=data at entry=0xbe9684b8) at
> /usr/src/debug/heaptrack/1.4.0-r0/git/src/track/trace_libunwind.cpp:64
> #4  0xb6fa43c4 in Trace::fill (skip=2, this=0xbe9684b0) at
> /usr/src/debug/heaptrack/1.4.0-r0/git/src/track/trace.h:44
> #5  heaptrack_malloc (ptr=ptr at entry=0x43f258, size=4936) at
> /usr/src/debug/heaptrack/1.4.0-r0/git/src/track/libheaptrack.cpp:845
> #6  0xb6fa1ada in malloc (size=<optimized out>) at
> /usr/src/debug/heaptrack/1.4.0-r0/git/src/track/heaptrack_preload.cpp:214
> #7  0xb6153792 in BKNI_Malloc_tagged () from /usr/lib/libnexus.so
> #8  0xb6d070a4 in bipc_client_create () from /usr/lib/libnxclient.so
> #9  0xb6d04a84 in ?? () from /usr/lib/libnxclient.so
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)

As I said - create an MWE and report a bug. And try to use UNW_ARM_METHOD=4.

> 2) In certain cases, it is not possible to preload
> libheaptrack_preload.so to the program. Although the library is
> present in the specified path and has the necessary permissions.
> 
> Starting program: /usr/bin/env
> LD_PRELOAD=/usr/lib/heaptrack/libheaptrack_preload.so
> /usr/bin/audiocap
> process 22570 is executing new program: /usr/bin/audiocap
> ERROR: ld.so: object '/usr/lib/heaptrack/libheaptrack_preload.so' from
> LD_PRELOAD cannot be preloaded (cannot open shared object file):
> ignored.

Create an MWE and report a bug.

> On Thu, Jun 15, 2023 at 12:50 PM Milian Wolff <mail at milianw.de> wrote:
> > On Mittwoch, 14. Juni 2023 22:49:18 CEST sindhu krishnan wrote:
> > > Thank you For the inputs!
> > > 
> > > I'm using heaptrack version 1.2.0 and libunwind 1.3.1. I will try with
> > > libunwind version 1.6.2.
> > > 
> > > Is there any way to provide debug symbols separately when using a
> > > stripped
> > > binary?
> > 
> > Yes, with `heaptrack --record-only` followed by a manual invocation of
> > `heaptrack_interpret` (see heaptrack bash file for examples). Note that we
> > don't yet have good support to add custom sysroot or library search paths
> > though - patches welcome.
> > 
> > <snip>
> > 
> > > How do I execute heaptrack for a running process? Do I only need to
> > > attach
> > > the process to heaptrack, or can I modify the service file to start the
> > > process directly with heaptrack?
> > 
> > That's up to you, pick whatever you want/need.
> > 
> > Cheers
> > --
> > Milian Wolff
> > mail at milianw.de
> > http://milianw.de


-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/heaptrack/attachments/20230619/90de2217/attachment.sig>


More information about the Heaptrack mailing list