-
Notifications
You must be signed in to change notification settings - Fork 135
Keep a rebased object out of the null page #765
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
Open
zardus
wants to merge
3
commits into
master
Choose a base branch
from
feature/externzero
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
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.
Shouldn't this be based on the actual page size instead of hardcoded?
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.
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
There is no actual page size to read here, so the constant is now a floor rather than the answer. What I checked:
Archdefines a page-size attribute, on any architecture — surveyed AMD64, X86, ARM, AArch64, MIPS32, PPC64, S390X, RISCV64 andArchPcode(including the 24-bitavr8:LE:24:xmega); none carries any page-related attribute.Loader.page_size, which defaults to0x1— "the granularity with which data is mapped into memory", i.e. target page size unknown. It carries a real page size when a core dump's mappings note supplies one (elfcore.pysetsself.loader.page_sizefrom the parsed note) or when the caller states one. It is assigned inLoader.__init__before any object is mapped, so it is available where_find_safe_rebase_addrruns.So as of d160d97 the guard is
max(self.page_size, NULL_PAGE_SIZE): one target page where the loader knows the page size, and the conventional 4 KB floor where it does not —max(1, 0x1000)leaves every existing configuration unchanged. A load statingpage_size=0x2000now keeps both pages a null pointer could land in out of the placement;test_rebase.py::test_null_guard_tracks_the_loader_page_sizepins that (it places the object at 0x1000 without the change and at 0x2000 with it). Full cle suite: 243 passed, 9 skipped.