RFR: 8369515: Deadlock between JVMTI and JNI ReleasePrimitiveArrayCritical
David Holmes
dholmes at openjdk.org
Tue Dec 16 11:33:53 UTC 2025
On Tue, 16 Dec 2025 08:29:32 GMT, Richard Reingruber <rrich at openjdk.org> wrote:
> > > I do think that also entering a critical region is problematic if it is nested.
> >
> >
> > Isn't nesting critical regions against the rules of using critical regions?
>
> For arrays it's explicitly allowed in the specification. There's also an example how to do it properly :) I'll see if I can implement a reproducer.
Right I see that. It states:
> Inside a critical region, native code must not call other JNI functions, ...
but then explicitly allows the critical functions themselves to be an exception. Okay.
So isn't a fix for this simply to skip blocking as per your PR:
if (is_obj_deopt_suspend() && !in_critical()) {
irrespective of nesting and without any need for any of the changes I proposed?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28779#issuecomment-3660076633
More information about the serviceability-dev
mailing list