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
8258380: [JVMCI] don't clear InstalledCode reference when unloading JVMCI nmethods #1777
Conversation
|
@tkrodriguez The following label 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 list. If you would like to change these labels, use the /label pull request command. |
@fisk any thoughts on this bug? |
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.
Right. It is definitely assumed that the transition to is_unloading() is completely monotonic. And it seems like the clearing could violate that indeed.
Worth noticing is that with concurrent class unloading, the make_unloaded operation is split into two: 1. unlinking, 2. deleting stuff. This operation would go under unlinking. Hence, it would need to check for is_unloading instead of is_unloaded, as the unlinking happens before the nmethod becomes unloaded. But we can cross that bridge when we get there I suppose. Looks good.
@tkrodriguez 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 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the
|
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.
As noted in JBS report this fix needs to be re-based to JDK 16 repo (with new PR) and pushed there.
It will be automatically forward ported into JDK 17 later.
Moved to openjdk/jdk16#25 |
We have been getting crashes running our unit tests in our gates with JDK15. The crashes are mostly in nmethod::is_unloaded because IsUnloadingBehaviour::current() is null. It seemed like there was some inconsistency in the notion of is_unloading for JVMCI nmethods that was leading to the crashes. I noticed that the is_unloading path rescans the nmethod using a closure to determine if it's unloading and since make_unloaded will clear the InstalledCode reference at the end if you ran the closure again it might return false since the oop is now null instead of being an unmarked oop. There's no point in the clearly the oop in this path anyway since the nmethod is dead and leaving the oop around seem to solve this crash. We're only see this crash in 15 but I don't see why it couldn't occur in 11 or later.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1777/head:pull/1777
$ git checkout pull/1777