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

Improve main executable detection #44

Merged
merged 1 commit into from
May 20, 2024
Merged

Conversation

javierhonduco
Copy link
Owner

The logic here is a bit flimsy and should be reworked, but let's at least mark first executables as the "main" ones.

More context in the comment but overall this is not always correct, in particular Rust + static musl is broken due how the loader operates for that case.

We should understand the kernel and loader's logic in detail and fully replicate it here.

Test Plan

Ran locally for several minutes without issues. The profilers looked good (see PR) and 0 unexpected errors were emitted.

The logic here is a bit flimsy and should be reworked, but let's at
least mark first executables as the "main" ones.

More context in the comment but overall this is not always correct, in
particular Rust + static musl is broken due how the loader operates for
that case.

We should understand the kernel and loader's logic in detail and fully
replicate it here.

Test Plan
=========

Ran locally for several minutes without issues. The profilers looked
good (see PR) and 0 unexpected errors were emitted.
@javierhonduco
Copy link
Owner Author

cc @gmarler. I will spend some time when I have the cycles improving this because it's not 100% correct in some situations, I don't think this is standardized anywhere so reading the kernel / loader sources might be the only way to do this properly

@javierhonduco javierhonduco merged commit 4eedba4 into main May 20, 2024
8 checks passed
@javierhonduco javierhonduco deleted the improve-main-exec-detection branch May 20, 2024 09:39
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.

1 participant