libbacktrace
libbacktrace copied to clipboard
[PATCH] fix symbol search loop at debuglink mode
Some distribs like ubuntu'18 creatively name files with debug symbols.
(same name without .debug suffix). And give no build-id
way.
$dpkg -L libc6-dbg | grep -v gconv /usr/lib/debug/.build-id/68/f36706eb2e6eee4046c4fdca2a19540b2f6113.debug /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so
$ dpkg -L libc6 /lib/x86_64-linux-gnu/libc-2.27.so /lib/x86_64-linux-gnu/libc.so.6
$ objdump -s -j .gnu_debuglink -j .note.gnu.build-id
/lib/x86_64-linux-gnu/libc-2.27.so
Contents of section .gnu_debuglink: 0000 6c696263 2d322e32 372e736f 00000000 libc-2.27.so.... 0010 5ac51387 Z... Contents of section .note.gnu.build-id: 0270 04000000 14000000 03000000 474e5500 ............GNU. 0280 ce450eb0 1a5e5acc 7ce7b8c2 633b02cc .E...^Z.|...c;.. 0290 1093339e ..3.
So elf_find_debugfile_by_debuglink("libc") loops back to /lib/x86_64-linux-gnu/libc-2.27.so and can't lookup symbols for libc and another standard libs. This patch breaks this loop and allows to lookup for symbols at other places.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
What to do if you already signed the CLA
Individual signers
- It's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
Corporate signers
- Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the Google project maintainer to go/cla#troubleshoot (Public version).
- The email used to register you as an authorized contributor must be the email used for the Git commit. Check your existing CLA data and verify that your email is set on your git commits.
- The email used to register you as an authorized contributor must also be attached to your GitHub account.
ℹ️ Googlers: Go here for more info.
@googlebot I signed it!
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.
. If the bot doesn't comment, it means it doesn't think anything has changed.
ℹ️ Googlers: Go here for more info.
FYA @ianlancetaylor