-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix elf segment matching (again) #318
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DsoOrigin indicates if Dso information was obtained from a perf mmap event or from parsing proc maps.
When a new mapping is inserted, if it intersects other mappings, keep the remaining parts of the existing mappings if mapped file is the same or if new mapping is anonymous and it truncates the end of an existing mapping.
Also explicits why expected return value of sscanf does not match number of specifiers.
If all mappings are available (ie. they come from proc maps), then use the first LOAD segment (executable or not) to compute the bias.
nsavoire
force-pushed
the
nsavoire/fix_elf_segment_matching
branch
from
October 5, 2023 00:08
a8d8042
to
b8efd7a
Compare
r1viollet
reviewed
Oct 5, 2023
Dso dso2{5, 0x2000, 0x4fff, 0x1000, "libfoo.so.1", 0, PROT_READ | PROT_EXEC}; | ||
dso_hdr.insert_erase_overlap(Dso{dso2}); | ||
|
||
ASSERT_EQ(dso_hdr.get_nb_dso(), 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for this test.
r1viollet
approved these changes
Oct 5, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for thoroughly looking into tricky load behaviours
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
If all mappings are available (ie. they come from proc maps), then use the first LOAD segment (executable or not) to compute the bias.
This will ensure that bias computation is possible even for processes that punch holes into existing mappings (eg.dotnet).
Other changes:
DsoOrigin indicates if Dso information was obtained from a perf mmap event or from parsing proc maps.
*Only adjust Dso end if smaller
When a new mapping is inserted, if it intersects other mappings, keep the remaining parts of the existing mappings if mapped file is the same or if new mapping is anonymous and it truncates the end of an existing mapping.
Also explicits why expected return value of sscanf does not match number of specifiers.