RFR: 8373839: Disable JVM TI suspension during JNI critical regions

Leonid Mesnik lmesnik at openjdk.org
Thu Dec 18 16:13:44 UTC 2025


On Thu, 18 Dec 2025 01:24:42 GMT, David Holmes <dholmes at openjdk.org> wrote:

> To ensure JNI critical access to a raw array can't interfere with actions of the debugger, we disable JVM TI suspension whilst JNI critical access is active, as originally suggested by @fisk. We assume the debugger is being operated correctly (ie the thread using the raw array will be suspended), and that the critical section is short so as to not delay debugging too long. 
> 
> The mechanism for this already exists courtesy of the virtual thread support.
> 
> Testing:
>  - tiers 1 - 6 sanity

The fix looks good. 
Do you think it makes a sense to add regression test?

-------------

Marked as reviewed by lmesnik (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28884#pullrequestreview-3593771798


More information about the serviceability-dev mailing list