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

Make exegesis annotator work with mappings that aren't page aligned #33

Merged

Conversation

boomanaiden154
Copy link
Collaborator

This patch makes the exegesis annotator work with mappings that are not page aligned. Currently if a segfault occurs at an address that isn't page aligned, Exegesis will try and map an address at that address and then the mmap call will silently fail as there is no error handling wired up for that and it will segfault again, thus creating a loop within the annotator.

This patch makes the exegesis annotator work with mappings that are not
page aligned. Currently if a segfault occurs at an address that isn't
page aligned, Exegesis will try and map an address at that address and
then the mmap call will silently fail as there is no error handling
wired up for that and it will segfault again, thus creating a loop
within the annotator.
@mtrofin
Copy link
Collaborator

mtrofin commented Feb 3, 2024

here is no error handling wired up for that

Should there be one wired up then?

Copy link
Collaborator

@mtrofin mtrofin left a comment

Choose a reason for hiding this comment

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

lgtm, with a suggestion

@boomanaiden154
Copy link
Collaborator Author

Should there be one wired up then?

Yes. It's been on my todo list for a while. It's not trivial to add though as the mmap calls that potentially fail are in the assembled benchmark snippet which is manually created assembly using the LLVM APIs. So it's possible to do a conditional jump if %rax after syscall isn't the expected value and then exit from there, but I haven't looked at implementing it yet.

This is also less of an issue if assertions are enabled as llvm/llvm-project#75554 adds an assertion that triggers when this case occurs (which I did hit after bumping the LLVM version).

@boomanaiden154 boomanaiden154 merged commit 1cc6a50 into google:main Feb 3, 2024
6 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.

2 participants