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
8254874: ZGC: JNIHandleBlock verification failure in stack watermark processing #701
Conversation
|
/label add hotspot-gc |
@stefank |
@stefank This change now passes all automated pre-integration checks. 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 6 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
|
The changes look good. It is confusing however that klass is also a local variable in a few functions, hiding the static version from scope, but this is a pre-existing problem.
Hi Stefan,
The fix looks good.
Thank you for catching this.
The test has 4 more static variables which are not used in the events handlers.
Thanks,
Serguei
Thanks for reviewing! |
/integrate |
@stefank Since your change was applied there have been 13 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 672f566. |
The cm03t001 test creates a local JNI handle in the prepare function. It later uses that handle from a callback function, from another thread. When the callback runs, ZGC applies a load barrier to that handle and self-heals it in the other threads stack. Later when that thread verifies its stack, during the start of its stack processing, it finds that the oop is unexpectedly not "bad".
It's invalid to send a local JNI handle over to another thread:
https://docs.oracle.com/en/java/javase/15/docs/specs/jni/design.html#global-and-local-references
So, my proposed fix is to convert the local handle to a global handle.
I've tested this with the reproducer in the bug report.
Progress
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/701/head:pull/701
$ git checkout pull/701