-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8350649: Class unloading accesses/resurrects dead Java mirror after JDK-8346567 #23775
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
8350649: Class unloading accesses/resurrects dead Java mirror after JDK-8346567 #23775
Conversation
|
👋 Welcome back shade! A progress list of the required criteria for merging this PR into |
|
@shipilev 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 38 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 |
|
@coleenp, JDK-8346567 is yours, want to take a look? |
Webrevs
|
coleenp
left a comment
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.
No, we don't really want a duplicate of this field. We should just recompute them from the access flags since they don't change. If you're dubious about the value being the same make cached_modifier_flags be DEBUG_ONLY() and compare against compute_modifier_flags() result.
coleenp
left a comment
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.
It's only JFR that looks at modifier_flags after the mirror is dead, if I understand correctly.
|
|
ciEnv shouldn't be looking at modifier_flags from a dead mirror, though? If it's possible, then you can add modifier_flags to ciKlass to cache the value there. I wouldn't be unhappy with that. |
|
So I think JFR can just call |
…three commits in the row
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.
Yes, this looks good. computer_modifier_flags() should get the same answer whenever it's called. Your comment looks good. JFR do_write_class during unloading is something that's been tricky in the past, but I hope there is nothing else that accesses the mirror when it's dead and the class should be unloaded.
Was there a reproducer that can be added with this change? I assume ZGC could have the same sort of problem.
Existing |
|
If existing tests fail reliably, then there's no need to add a new test. Looks like JDK-8337978 has proven its value! |
|
Thanks for reviews! Local testing passes fine, so I am integrating. /integrate |
|
Going to push as commit ec6624b.
Your commit was automatically rebased without conflicts. |
See bug for description of the bug. Shenandoah seems to be the only GC that runs into this problem so far.
Before JDK-8346567, we pulled class modifiers from the native
Klass*, and so we bypassed this trouble. But now we take modifiers out of Java mirror, and this happens during unloading, which accesses/resurrects potentially dead mirror.Additional testing:
hotspot_gc_shenandoahjdk_jfrjdk_jfrwith-XX:+UseShenandoahGCnow passesProgress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23775/head:pull/23775$ git checkout pull/23775Update a local copy of the PR:
$ git checkout pull/23775$ git pull https://git.openjdk.org/jdk.git pull/23775/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23775View PR using the GUI difftool:
$ git pr show -t 23775Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23775.diff
Using Webrev
Link to Webrev Comment