Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8260194

Update the documentation for -Xcheck:jni

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 17
    • hotspot
    • 9
    • b28

        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.

              dholmes David Holmes
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: