Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report: use library search order from ld.so #354

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bdrung
Copy link
Collaborator

@bdrung bdrung commented Jun 13, 2024

Use the same library search order from ld.so:

$ ld.so --help
[...]
Shared library search path:
  (libraries located via /etc/ld.so.cache)
  /lib/x86_64-linux-gnu (system search path)
  /usr/lib/x86_64-linux-gnu (system search path)
  /lib (system search path)
  /usr/lib (system search path)

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.01%. Comparing base (75a7fd9) to head (813fb4a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #354      +/-   ##
==========================================
+ Coverage   83.00%   83.01%   +0.01%     
==========================================
  Files          99       99              
  Lines       20333    20352      +19     
  Branches     3212     3218       +6     
==========================================
+ Hits        16877    16896      +19     
+ Misses       2936     2935       -1     
- Partials      520      521       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

apport/report.py Outdated
f":{gdb_sandbox}/lib/{native_multiarch}"
f":{gdb_sandbox}/usr/lib/{native_multiarch}"
f"{gdb_sandbox}/lib"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Rather than a hardcoded list, shouldn't we actually query the local ld.so to get the search order?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You asked for it. Now you get a bigger merge request!

@bdrung bdrung force-pushed the lib-search-order branch 3 times, most recently from 7e9693b to 9887383 Compare July 11, 2024 10:51
@bdrung
Copy link
Collaborator Author

bdrung commented Jul 11, 2024

Problem with the implementation: jammy does not ship /usr/bin/ld.so.

@schopin-pro
Copy link
Contributor

I didn't even remember that /usr/bin/ld.so was a thing. Maybe just use /lib/$triplet/ld.*\.so\..*?

@bdrung bdrung force-pushed the lib-search-order branch from 9887383 to 2298507 Compare July 18, 2024 10:00
@bdrung bdrung force-pushed the lib-search-order branch from 2298507 to 4b142e3 Compare August 9, 2024 15:52
The library search order from `ld.so` differs from the hard-coded list:

```
$ ld.so --help
[...]
Shared library search path:
  (libraries located via /etc/ld.so.cache)
  /lib/x86_64-linux-gnu (system search path)
  /usr/lib/x86_64-linux-gnu (system search path)
  /lib (system search path)
  /usr/lib (system search path)
```

So determine the library search paths dynamically from `ld.so`.

Signed-off-by: Benjamin Drung <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants