Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8268926 | 18 | David Holmes | P4 | Resolved | Fixed | b03 |
JDK-8270566 | 17.0.1 | David Holmes | P4 | Resolved | Fixed | b03 |
The -Xcheck:jni option is documented in the java "manpage" (aka command reference) and also in the Hotspot Troubleshooting guide. The description in the manpage is very brief:
-Xcheck:jni
Performs additional checks for Java Native Interface (JNI) functions. Specifically, it validates the parameters passed to the JNI function and the runtime environment data before processing the JNI request. It also checks for pending exceptions between JNI calls. Any invalid data encountered indicates a problem in the native code, and the JVM terminates with an irrecoverable error in such cases. Expect a performance degradation when this option is used.
while the TSG entry elaborates in more detail about some of the kinds of errors that are detected, and the responses to them. See:
https://docs.oracle.com/en/java/javase/15/troubleshoot/command-line-options1.html#GUID-DE9FAAAF-DCD4-4974-A86F-C6B8907CCE9A
Both sections are somewhat out-of-date with respect to the checks that have been in place since Java 9, and in particular the manpage does not make it clear that some checks will cause termination of the VM while others will only generate a warning.
I will use this main bug to update the manpage, and create a doc subtask for the TSG.
-Xcheck:jni
Performs additional checks for Java Native Interface (JNI) functions. Specifically, it validates the parameters passed to the JNI function and the runtime environment data before processing the JNI request. It also checks for pending exceptions between JNI calls. Any invalid data encountered indicates a problem in the native code, and the JVM terminates with an irrecoverable error in such cases. Expect a performance degradation when this option is used.
while the TSG entry elaborates in more detail about some of the kinds of errors that are detected, and the responses to them. See:
https://docs.oracle.com/en/java/javase/15/troubleshoot/command-line-options1.html#GUID-DE9FAAAF-DCD4-4974-A86F-C6B8907CCE9A
Both sections are somewhat out-of-date with respect to the checks that have been in place since Java 9, and in particular the manpage does not make it clear that some checks will cause termination of the VM while others will only generate a warning.
I will use this main bug to update the manpage, and create a doc subtask for the TSG.
- backported by
-
JDK-8268926 Update the documentation for -Xcheck:jni
- Resolved
-
JDK-8270566 Update the documentation for -Xcheck:jni
- Resolved