WuBingzheng / libleak

detect memory leak by LD_PRELOAD, without changing the target program
249 stars 52 forks source link

Any way to load debug symbols for system libs? #20

Open positron96 opened 3 years ago

positron96 commented 3 years ago

Hello and thanks for this tool! It looks that It might help me, but I have not yet obtained useful information from it. What might help me are function names in stack info from standard libraries (libc, libstdc++). I have Ubuntu and have installed debug symbols for these libraries. As I understand, they are located in separate files somewhere in /usr/lib/debug. Gdb uses those, but libleak doesn't, so stacks with libc-2.23.so have no function name and only have an address. Is there a way to make use of those symbols?

WuBingzheng commented 3 years ago

libleak uses libbacktrace to display the stack information. And it seems that libbacktrace tries to load debug information by build-id. Maybe you can check the build-id of your symbol-file under /usr/lib/debug/.

Another way is tool addr2line. I do not know if it loads debug information or not. But you can try it.