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
8255131: G1CollectedHeap::is_in() returns wrong result #799
Conversation
|
Webrevs
|
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.
Looks good!
@tschatzl This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 89 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
|
bool available = _hrm->is_available(addr_to_region((HeapWord*)p)); | ||
if (contains && available) { | ||
if (is_in_reserved(p) && | ||
_hrm->is_available(addr_to_region((HeapWord*)p))) { |
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 line is misindented. But rather than adjusting the indentation, how about instead changing the function to
bool G1CollectedHeap::is_in(const void* p) const {
return is_in_reserved(p) && _hrm->is_available(addr_to_region((HeapWord*)p));
}
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.
I was thinking something similar, so I would approve going with this proposal.
Changed as requested. Had a discussion with ayang about the specification of CollectedHeap::is_in(): it reads |
Thanks @kimbarrett @albertnetymk @kstefanj for your reviews! /integrate |
@tschatzl Since your change was applied there have been 89 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit c520469. |
Hi all,
please review this change to exchange the broken G1CollectedHeap::is_in() by G1CollectedHeap::is_in_exact() that has the same performance profile and correct.
G1CollectedHeap::is_in() returns true for any region ever committed (and crashes for not yet committed regions), while is_in_exact() (almost) did the right thing. Almost because HeapRegionManager::is_available() would assert if the given pointer is outside the heap and it's not guarded by is_in_reserved.
Test: tier1
Thanks,
Thomas
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/799/head:pull/799
$ git checkout pull/799