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

Race in adding and checking (weak) global JNI handles

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 9
    • hotspot
    • None

      There are insufficient memory barriers in the code that adds global JNI handles to the global JNIHandleBlocks and reading from them.

      Neither the code that adds handles to JNIHandleBlocks has appropriate memory barriers nor the code reading (JNIHandleBlock::chain_contains()) from it has any memory barriers preventing read of stale values.

      The reader code is at least used in JNIHandles::is_[weak_]global_handle.

      It should at least be possible to make a few asserts fail, crash the VM with a Fatal JNI error (although it should not), and return wrong values in the GetObjectRefType() JNI method.

            Unassigned Unassigned
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: