-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8361342: Shenandoah: Evacuation may assert on invalid mirror object after JDK-8340297 #26187
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
Closed
tstuefe
wants to merge
6
commits into
openjdk:master
from
tstuefe:JDK-8361342-Sheandoah-evacuation-asserts-on-invalid-mirror-object-after-JDK-8340297
Closed
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a9c3c58
start
tstuefe 3d07a9d
also fix ShenandoahVerifier
tstuefe e8d7c5a
Merge branch 'master' into JDK-8361342-Sheandoah-evacuation-asserts-o…
tstuefe 4d23ef7
Merge branch 'master' into JDK-8361342-Sheandoah-evacuation-asserts-o…
tstuefe fba14a0
Also check array klass
tstuefe c33cf24
Alekseys additions
tstuefe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,7 +269,15 @@ void ShenandoahAsserts::assert_correct(void* interior_loc, oop obj, const char* | |
// We want to check class loading/unloading did not corrupt them. | ||
|
||
if (Universe::is_fully_initialized() && (obj_klass == vmClasses::Class_klass())) { | ||
Metadata* klass = obj->metadata_field(java_lang_Class::klass_offset()); | ||
// During class redefinition the old Klass gets reclaimed and the old mirror oop's Klass reference | ||
// nulled out (hence the "klass != nullptr" condition below). However, the mirror oop may have been | ||
// forwarded if we are in the mids of an evacuation. In that case, the forwardee's Klass reference | ||
// is nulled out. The old, forwarded, still still carries the old invalid Klass pointer. It will be | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/still still/still |
||
// eventually collected. | ||
// This checking code may encounter the old copy of the mirror, and its referee Klass pointer may | ||
// already be reclaimed and therefore be invalid. We must therefore check the forwardee's Klass | ||
// reference. | ||
const Metadata* klass = fwd->metadata_field(java_lang_Class::klass_offset()); | ||
if (klass != nullptr && !Metaspace::contains(klass)) { | ||
print_failure(_safe_all, obj, interior_loc, nullptr, "Shenandoah assert_correct failed", | ||
"Instance class mirror should point to Metaspace", | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
s/mids/midst