-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8341020: Error handler crashes when Metaspace is not fully initialized #21206
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 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 9 new commits 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
|
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!
Thanks
@@ -992,6 +992,7 @@ bool Metaspace::is_in_shared_metaspace(const void* ptr) { | |||
|
|||
// Returns true if pointer points into one of the non-class-space metaspace regions. | |||
bool Metaspace::is_in_nonclass_metaspace(const void* ptr) { | |||
return VirtualSpaceList::vslist_nonclass()->contains((MetaWord*)ptr); | |||
VirtualSpaceList* list = VirtualSpaceList::vslist_nonclass(); | |||
return (list != nullptr) && list->contains((MetaWord*) ptr); |
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 about this. This, and a number of other related functions nearby,
all seem like they should have Metaspace::initialized() as a precondition. And
the call to Metaspace::contains in os::print_location should be conditional on
Metaspace::initialized(). (There may be other "is initialized" checks that
should be made by (and offered to) os::print_location, but that's beyond the
scope of this change.)
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.
FWIW, we had a similar discussion in #19435.
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.
All of these methods are public. I think that it seems sane to assume that they are the boundary for checking whether Metaspace is initialized before doing something.
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.
All right, I think checking for Metaspace::initialized()
in os::print_location
is more in line with other changes, notably JDK-8333290. This is Kim's suggestion, I think. So I did just that.
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.
Thanks, this looks good to me.
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 to me.
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.
Thank you! /integrate |
Going to push as commit 7f4ed50.
Your commit was automatically rebased without conflicts. |
When debugging CDS, I asked for
os::print_location
when Metaspace was not completely initialized. I suspect the same might happen if error handler fires very early in startup sequence.os::print_location
got toMetaspace::contains
, which ended up inMetaspace::is_in_nonclass_metaspace
, which crashed, sinceVirtualSpaceList
was null. Other checks inMetaspace::contains
seem to only check the address against the boundaries, and are not affected.Additional testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21206/head:pull/21206
$ git checkout pull/21206
Update a local copy of the PR:
$ git checkout pull/21206
$ git pull https://git.openjdk.org/jdk.git pull/21206/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21206
View PR using the GUI difftool:
$ git pr show -t 21206
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21206.diff
Webrev
Link to Webrev Comment