JDK-8174791 : Race in adding and checking (weak) global JNI handles
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2017-02-11
  • Updated: 2017-02-12
  • Resolved: 2017-02-12
Related Reports
Duplicate :  
Relates :  
Description
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.
Comments
Nothing. I got a JIRA error when submitting JDK-8174790, and could not find it in a quick search. So I created another one. Closing this.
12-02-2017

What is the difference between this issue and JDK-8174790?
12-02-2017