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

Read ELF SONAMEs directly from process memory when possible. #117

Merged
merged 4 commits into from
Jun 27, 2024

Conversation

afranchuk
Copy link
Contributor

@afranchuk afranchuk commented Apr 19, 2024

When this fails, it falls back to the previous behavior of trying to open the mapped file name directly.

Closes #79.

When this fails, it falls back to the previous behavior of trying to
open the mapped file name directly.

Closes rust-minidump#79.
@afranchuk
Copy link
Contributor Author

I'll update the ELF fixture to add an SONAME to test this.

@gabrielesvelto
Copy link
Contributor

Sorry my review is taking a bit but I'm doing some testing directly in Firefox and this seems to work only for external libraries, not our own ones, so I'm trying to figure out what's wrong (or if it's something specific to my box).

@afranchuk
Copy link
Contributor Author

Not all binaries have the section header table present when loaded in memory. However the program headers will be there, so I added another path which is preferred and uses only the program headers and the dynamic section information. This seems to work with all shared objects loaded by firefox at runtime when I tested it. We might still want a fallback of trying to load directly from the file (if present) if reading from memory fails for some reason.

@afranchuk
Copy link
Contributor Author

I'm not sure why the android test is failing...

@afranchuk afranchuk requested a review from gabrielesvelto May 28, 2024 18:49
Comment on lines +14 to +15
# By default the linker _doesn't_ generate a build-id, however we want one for our tests.
rustflags = ["-C", "link-args=-Wl,--build-id=sha1"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch!

@afranchuk
Copy link
Contributor Author

This is probably ready to merge.

@afranchuk afranchuk requested a review from gabrielesvelto June 25, 2024 14:01
Copy link
Contributor

@gabrielesvelto gabrielesvelto left a comment

Choose a reason for hiding this comment

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

Indeed, LGTM

@gabrielesvelto gabrielesvelto merged commit 9e748df into rust-minidump:main Jun 27, 2024
16 checks passed
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.

Support libraries mapped from within APKs on Android
3 participants