-
Notifications
You must be signed in to change notification settings - Fork 143
8374729: [lworld] Enabling CDS crash with UseAltSubstitutabilityMethod #1903
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
Conversation
|
👋 Welcome back matsaave! A progress list of the required criteria for merging this PR into |
|
@matias9927 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 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 ➡️ To integrate this PR with the above commit message to the |
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.
This looks good but I have a couple of small comments.
| // See comment of LIMITATION above | ||
| // Any concrete value class will have a field ".null_reset" which holds an | ||
| // all-zero instance of the value class so it will not change between | ||
| // dump time and runtime. |
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'm not sure how this comment about the .null_reset value applies in this if statement? It doesn't seem related to the LIMITATION comment above and there doesn't seem to be anything special done for null reset here either.
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.
Without the if statement, we'd see an error stating that a class has a static field whose value may differ between dumptime and runtime, specifically referring to .null_reset. This is currently the only case to cause any issues so I figured mentioning it in a comment would be useful.
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.
ok
| if (ik->is_inline_klass() && ik->is_initialized()) { | ||
| // Only concrete value classes need the null_reset field | ||
| InlineKlass* ilk = InlineKlass::cast(k); | ||
| if (ilk->has_nullable_atomic_layout()) { |
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.
If PR #1407 is pushed before this PR, this test will have to be changed to
if (ilk->supports_nullable_layouts()) {
| map_h->int_at_put(i, _acmp_maps_array->at(i)); | ||
| } | ||
| java_mirror()->obj_field_put(_acmp_maps_offset, map_h()); | ||
| } |
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.
Is it necessary to restore null_reset_value() as well?
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.
The null reset value is generated in InstanceKlass:initialize() so we don't need to regenerate it here.
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.
Mostly good, but one thing needs to be changed.
| // See comment of LIMITATION above | ||
| // Any concrete value class will have a field ".null_reset" which holds an | ||
| // all-zero instance of the value class so it will not change between | ||
| // dump time and runtime. |
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.
ok
|
@matias9927 this pull request can not be integrated into git checkout substitutability_cds
git fetch https://git.openjdk.org/valhalla.git lworld
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge lworld"
git push |
fparain
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.
LGTM
| @@ -0,0 +1,286 @@ | |||
| /* | |||
| * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. | |||
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.
Can you fix the copyright to just 2026 since it appears to be a new test?
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.
Thank you! Nice work!!
|
@matias9927 Pushed as commit 8f8398e. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The alternate substitutability method relies on an injected Java object "acmp_maps" which is currently not being archived and thus leads to crashes attempting to run with a CDS archive. The issue stems from inline klasses being archived and thus loaded at dumptime while the acmp_maps oops is generated in the class file parser, leading this oop to be absent at runtime.
Additionally, the other injected static field "null_reset" was not being archived either, so both of these fields are properly stored in the archived heap. In the case of CDS/AOT configurations where the heap is not dumped, acmp_maps is regenerated at class loading using a copy of the array stored in metadata.
Tests and APIs are updated to conform to the new output generated by the use of acmp_maps and remove some test cases which target the old substitutability method.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1903/head:pull/1903$ git checkout pull/1903Update a local copy of the PR:
$ git checkout pull/1903$ git pull https://git.openjdk.org/valhalla.git pull/1903/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1903View PR using the GUI difftool:
$ git pr show -t 1903Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1903.diff
Using Webrev
Link to Webrev Comment