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.
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.
- duplicates
-
JDK-8174790 Race adding (weak) global JNI handles and determining type of handle
-
- Resolved
-
- relates to
-
JDK-8174790 Race adding (weak) global JNI handles and determining type of handle
-
- Resolved
-