RFR: 8254874: ZGC: JNIHandleBlock verification failure in stack watermark processing
Serguei Spitsyn
sspitsyn at openjdk.java.net
Fri Oct 16 16:52:18 UTC 2020
On Fri, 16 Oct 2020 14:29:46 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
> 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.
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
-------------
Marked as reviewed by sspitsyn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/701
More information about the serviceability-dev
mailing list