-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8320002: Remove obsolete CDS check in Reflection::verify_class_access() #17232
8320002: Remove obsolete CDS check in Reflection::verify_class_access() #17232
Conversation
/label add hotspot-runtime |
👋 Welcome back ccheung! A progress list of the required criteria for merging this PR into |
@calvinccheung |
This would seem to introduce a change in behaviour. During dumping we may now get an access exception when previously access was assumed to be okay. |
During static dump, if an exception is encountered, it would just log a CDS warning message and continue processing the next entry in the classlist. For example, the code in classListParser.cpp. |
Exactly! It would skip the class that triggered the exception, which is a behaviour change to what happens now. |
The code that Calvin is removing is very old code. I guess at one time during the initial development of modules in JDK 9, even when the access was perfectly OK, the "real" check would fail because some information were not properly set up. So as a hack, someone added:
Unfortunately there's no history for why this hack was added: However, that problem doesn't exist anymore, so we can remove this hack. Yes, this changes behavior. However, we run a very limited set of Java code during "java -Xshare:dump". Specifically, we never execute any user-supplied code. So even if we perform the real checks, we should always get ACCESS_OK anyway. If we don't, that will be a bug, and we better know about it. |
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.
LGTM.
@calvinccheung 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 589 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 |
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! Thanks @iklam for the explanation.
Seems to me like this is/was simply a quick exit path: we know/expect all checks to pass so why bother actually performing them. I'm fine with now actually performing them, in case at some point something is added that could fail, as long as we don't expect anything to actually start failing now. Thanks. |
Thanks @dholmes-ora, @iklam, @matias9927 for the review. /integrate |
Going to push as commit 221fbfb.
Your commit was automatically rebased without conflicts. |
@calvinccheung Pushed as commit 221fbfb. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This fix removes an obsolete CDS check. Please review.
Passed tiers 1 - 4 testing.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17232/head:pull/17232
$ git checkout pull/17232
Update a local copy of the PR:
$ git checkout pull/17232
$ git pull https://git.openjdk.org/jdk.git pull/17232/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17232
View PR using the GUI difftool:
$ git pr show -t 17232
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17232.diff
Webrev
Link to Webrev Comment