-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8301988: VerifyLiveClosure::verify_liveness asserts on bad pointers outside heap #12456
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
8301988: VerifyLiveClosure::verify_liveness asserts on bad pointers outside heap #12456
Conversation
👋 Welcome back tschatzl! A progress list of the required criteria for merging this PR into |
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.
Mostly seems quite reasonable based on the description, but one query below.
Thanks.
@@ -214,7 +214,7 @@ inline bool G1CollectedHeap::requires_barriers(stackChunkOop obj) const { | |||
} | |||
|
|||
inline bool G1CollectedHeap::is_obj_filler(const oop obj) { | |||
Klass* k = obj->klass(); | |||
Klass* k = obj->klass_raw(); |
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.
Not clear how you can get here from HeapRegion::is_obj_dead
with a bad oop, such that you need the raw variant. ??
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 object is in the heap, but the occupying memory has already been zapped (in debug mode); i.e. the call in heapRegion.cpp:518
could read badHeapWordVal
as (compressed) klass value in the header.
In that case the current code asserts in this call because in oopDesc::klass()
, the call to CompressedKlassPointers::decode_not_null
will assert in compressedOops.inline.hpp:135
due to the check_alignment
condition not satisfied.
This makes this verification code assert before printing out any useful information to diagnose the problem quickly (in my case this has been a change that wrongly managed remembered sets).
If I had had the remembered set verification printout, I would have found the problem immediately in this case (because the message would have told me that there is a problem with remembered sets). So it took a while to diagnose the issue, having to go into the debugger to painfully find the exact same information.
I.e. this makes the verification code more robust.
Imo the suggested solution to just continue execution is fine, because is_obj_filler
will always return false (i.e. object is dead) for garbage objects and do the right thing here.
There is the concern that now other non-verification code might not immediately trigger now, but most of it just fails the VM anyway if it finds a bad reference (after printing some information about it), for all other cases this is the right choice.
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 the explanation.
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
@tschatzl 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 38 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 |
/label add hotspot-gc |
@tschatzl |
print_object(&ls, obj); | ||
} | ||
oop obj = CompressedOops::decode_raw_not_null(heap_oop); | ||
bool failed = false; |
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.
Unused.
Thanks @dholmes-ora @albertnetymk for your reviews /integrate |
Going to push as commit 0aeebee.
Your commit was automatically rebased without conflicts. |
Hi all,
can I have reviews for this change to liveness verification that fixes some unwanted asserts because
The first two issues are really annoying (there is another one when the
Klass
is garbage when callingis_obj_dead_cond
, but I'll try to improve that separately).Testing: local compilation/testing, gha
Thanks,
Thomas
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12456/head:pull/12456
$ git checkout pull/12456
Update a local copy of the PR:
$ git checkout pull/12456
$ git pull https://git.openjdk.org/jdk pull/12456/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 12456
View PR using the GUI difftool:
$ git pr show -t 12456
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12456.diff