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

David Holmes dholmes at openjdk.org
Thu Dec 18 01:43:50 UTC 2025


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

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

Commit messages:
 - 8373839: Disable JVM TI suspension during JNI critical regions

Changes: https://git.openjdk.org/jdk/pull/28884/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28884&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8373839
  Stats: 12 lines in 2 files changed: 10 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/28884.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28884/head:pull/28884

PR: https://git.openjdk.org/jdk/pull/28884


More information about the serviceability-dev mailing list