-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8360288: Shenandoah crash at size_given_klass in op_degenerated #26256
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
base: master
Are you sure you want to change the base?
8360288: Shenandoah crash at size_given_klass in op_degenerated #26256
Conversation
👋 Welcome back wkemper! A progress list of the required criteria for merging this PR into |
@earthling-amzn This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. 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 80 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. ➡️ To integrate this PR with the above commit message to the |
@earthling-amzn The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
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.
Yeah, this evidently does not work, see test failures.
Architecturally, the heuristics should be looking only at region data, without looking at objects. I see we often end up calling ShenandoahHeapRegion::required_regions(obj->size(), ...)
just to figure out how many HC regions are there in the chain. But we might as well scan regions from the given HS region, until we run out of HC regions.
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.
Three things:
-
Bug synopsis should generally reflect what is being done, not what the symptom is. There is a leeway: it can describe the problem that is being solved.
-
See the comment, "Reclaim from tail". Have you verified reclaiming from head is fine? If not, I think it is better to find the tail first, then walk it backwards. In fact, maybe it is a good time to introduce an utility method in
ShenandoahHeapRegion
that tells the tail of HC chain. There is alreadyShenandoahHeapRegion::humongous_start_region
that can have a symmetricShenandoahHeapRegion::humongous_end_region
. -
Generally, it looks brittle to touch objects during any heuristics calculation due to these lifecycle problems. There is another instance of
ShenandoahHeapRegion::required_regions(obj->size() * HeapWordSize);
inShenandoahGenerationalHeuristics::choose_collection_set
-- is it affected by the same issue?
Thanks for the review.
|
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.
To be clear, by "synopsis" you mean the description of the pull request?
Yes.
All right then, improve a synopsis and then we are good to go.
} | ||
return required_regions; | ||
regions_trashed++; | ||
region = get_region(region->index() + 1); |
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.
Micro-optimization opportunity: track index
as a local variable without introducing memory dependency on another region. Would likely pipeline a bit better.
I came across the same code recently when I update the choose_collection_set to support CAS for mutator allocation. I was searching and reviewing where ShenandoahHeapRegion::required_regions are used yesterday. There are 9 places where it is been used, out of which only the one in allocation is indeed needed. I was about to create a JBS bug for the improvement. |
MacOS test failure looks unrelated (test is running G1). |
Both degenerated and full GCs unload classes before reclaiming unmarked humongous objects. This may result in a null klass pointer dereference when reclaiming unmarked humongous objects. Prior to this change, the number of regions occupied by a humongous object was computed from the size of the object. To avoid using
oop::size
after class unloading on an unmarked object, Shenandoah now trashes the humongous start region followed by subsequent continuation regions.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26256/head:pull/26256
$ git checkout pull/26256
Update a local copy of the PR:
$ git checkout pull/26256
$ git pull https://git.openjdk.org/jdk.git pull/26256/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26256
View PR using the GUI difftool:
$ git pr show -t 26256
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26256.diff
Using Webrev
Link to Webrev Comment