Strengthen Xcheck:jni for JNI critical regions

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 25
    • Component/s: hotspot
    • gc

      JNI Spec Chapter 4 says:
      "Inside a “critical region” the native code should not run for an indefinite period of time, must not invoke arbitrary JNI functions, and must not perform operations that might cause the current thread to block and wait for another thread in the virtual machine. Given these restrictions, the virtual machine can temporarily disable garbage collection while giving the native code direct access to array elements."

      Since JDK-8375188 shows a misuse can deadlock the GC, I think we really want to have -Xcheck:jni to preempt these cases with more checks.

            Assignee:
            Aleksey Shipilev
            Reporter:
            Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: