-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8373411: Crash when PrintSharedArchiveAndExit is enabled but shared heap is disabled #28741
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
8373411: Crash when PrintSharedArchiveAndExit is enabled but shared heap is disabled #28741
Conversation
|
This is the assert that you get when hitting this issue: |
|
👋 Welcome back stefank! A progress list of the required criteria for merging this PR into |
|
@stefank 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 31 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 |
Webrevs
|
| * @modules java.base/jdk.internal.misc | ||
| * java.management |
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 this required?
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 don't know. I copy-n-pasted the code from PrintSharedArchiveAndExit.java and didn't think about it.
| * | ||
| * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:SpecTrapLimitExtraEntries=0 compiler.arguments.TestSpecTrapLimitExtraEntries | ||
| * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:SpecTrapLimitExtraEntries=100 compiler.arguments.TestSpecTrapLimitExtraEntries | ||
| * @summary Testing -XX:+PrintSharedArchiveAndExit option with no shared heap |
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.
Please add bug ID.
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.
Just curious: why is that important? I would have guessed that the git history would be sufficient to figure this out.
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.
jtreg allows running the tests related to a particular bug ID: https://openjdk.org/jtreg/command-help.html -- although I don't know who uses this feature instead of just running the majority of the tests most of the time :)
-bug:<bugid> Run only those tests which apply to the given bugid.
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. I've never felt the need or want to use that :D. I'll add the bugid.
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 reason I asked for the bug ID:
The usage in this test is not common: java -XX:AOTCacheOutput=... -XX:+PrintSharedArchiveAndExit will not create the specified AOT cache. Having the bug ID will make it easy to understand why the test is written in this way.
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. I would have used git for that ...
shipilev
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.
Hold on, how does it crash? I cannot see right away how this would fail:
size_t StringTable::shared_entry_count() {
assert(HeapShared::is_loading_mapping_mode(), "should not reach here");
return _shared_table.entry_count();
}
class SimpleCompactHashtable {
...
inline size_t entry_count() const {
return _entry_count;
}
...
}
static SharedStringTable _shared_table;
The assert in StringTable::shared_entry_count() is likely incomplete too.
Oh, so it fails the assert in the mode checker: All right. The assert in |
That one has been left as-is intentionally. We should never call |
|
I could change the code to: Personally, I think it is redundant, because the second assert would catch a failure of the first. But if you all think this is better, then I'll add it. |
Meh, can go either way. I won't quibble for this patch. Honestly, my expectation is that when |
Yes. We have had a few of those bugs at the end of the development cycle for the object streaming JEP.
I think Erik had it more like you suggest, but if I understood Ioi correctly he wanted things to be more explicit, and this is what we ended up with. I don't mind if someone wants to take a stab at restructuring this, but I'm not personally volunteering to do this. I would rather take the time to make other refactoring and renaming that we felt would benefit the heap sharing code, and we had hope to get to it after the JEP was delivered. However, the reality is that we're all prioritizing other work at the moment so I don't know if / when we'll get to that. |
|
Thanks for the reviews! Tier1 testing passed. |
|
Going to push as commit d854a04.
Your commit was automatically rebased without conflicts. |
Found this while poking around at Valhalla that turned off heap sharing. The fix is simple, there's a missing HeapShared::is_loading() check that we missed when refactoring the object streaming code.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28741/head:pull/28741$ git checkout pull/28741Update a local copy of the PR:
$ git checkout pull/28741$ git pull https://git.openjdk.org/jdk.git pull/28741/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28741View PR using the GUI difftool:
$ git pr show -t 28741Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28741.diff
Using Webrev
Link to Webrev Comment