-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8371216: oopDesc::print_value_on breaks if klass is garbage #28190
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
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back phubner! A progress list of the required criteria for merging this PR into |
|
@Arraying 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 28 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@tstuefe, @coleenp, @TheRealMDoerr) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Webrevs
|
tstuefe
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.
I would not add the helper function for only one case. We already have a bunch of helpers like these. Just test for oop != NULL at the call site.
In the scenario I am referring to, we had an always-non-null oop and went through I agree with you, it'd be nicer to check at the call site. How do you feel about inlining the proposed function into: if (obj != nullptr && obj->klass_without_asserts() == vmClasses::String_klass()) {
java_lang_String::print(obj, st);
print_address_on(st);
} else // [...] |
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.
I like the inlining option.
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!
TheRealMDoerr
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.
Thanks for fixing it!
I think there are more places which cause "error occurred during error reporting" due to assertions, but they can get addressed in separate issues.
|
Thanks for the feedback and reviews @tstuefe @coleenp @TheRealMDoerr. I'll integrate this on Monday when the 24h period has passed and my test re-runs are finished.
If you have any examples, either now or down the road, I'd be happy to take a look. |
An prominent example in the debug build is the following assertion: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/oops/compressedKlass.inline.hpp#L91 |
Hi all,
The
oopDesc::print_value_onfunction checks if an oop is a string, and if so just prints the raw string. To do this, it needs to read theklass(). If theklass()reads garbage, one of many assertion errors is likely triggered.For example, if G1's verification finds problematic oops, it will attempt to print them. If these oops have garbage (incorrect or racey) klasses, this will cause an assertion error, fail fast, and VM crash. G1 never finishes printing, which may make debugging more difficult. The developer can/will be made aware in other ways if the
klass()is garbage, for example by being told that it is not in the metaspace.We observed the above in Valhalla and already patched it there.
Testing: tiers 1-5 on Linux (x64, AArch64), macOS (x64, AArch64), Windows (x64).
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28190/head:pull/28190$ git checkout pull/28190Update a local copy of the PR:
$ git checkout pull/28190$ git pull https://git.openjdk.org/jdk.git pull/28190/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28190View PR using the GUI difftool:
$ git pr show -t 28190Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28190.diff
Using Webrev
Link to Webrev Comment