JDK-8274773 : [TESTBUG] UnsafeIntrinsicsTest intermittently fails on weak memory model platform
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 11,17,18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: ppc,aarch64
  • Submitted: 2021-10-05
  • Updated: 2023-01-04
  • Resolved: 2021-10-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 18
11.0.14Fixed 17.0.2Fixed 18 b19Fixed
Related Reports
Relates :  
Description
We observed test failures with NullPointerException when running the test with experimental ZGC on PPC64:
java.lang.NullPointerException: Cannot invoke "compiler.gcbarriers.Node.next()" because "this.current" is null
	at compiler.gcbarriers.Runner.run(UnsafeIntrinsicsTest.java:226)

It failed while "Testing Load with 4 thread and 133700 nodes".

During "testWithSharedData", "mergeImplLoad" calls "setNext" to install newly created Nodes without any memory barrier. Note that the field "Node.next" is not volatile. The JMM does not require concurrent readers to observe any field updates which were done before inserting the new Nodes. So, it's legal that the concurrent reader sees "Node.next == null".
Comments
Fix Request (11u): ZGC and ShenandoahGC on aarch64 are affected in 11u. Backport needed manual integration due to unrelated context changes, but Skara recognizes it as clean backport: https://github.com/openjdk/jdk11u-dev/pull/650
23-11-2021

Fix Request (17u): Test failures can be observed with ZGC on PPC64. So, this simple test fix should get backported before backporting new GCs on PPC64. In addition, failures were observed during development of generational ZGC on aarch64. Fix applies cleanly.
15-10-2021

Changeset: 49f8ce6e Author: Martin Doerr <mdoerr@openjdk.org> Date: 2021-10-11 10:31:54 +0000 URL: https://git.openjdk.java.net/jdk/commit/49f8ce6e9c797cd11ea586e3cf87398888bc8cf1
11-10-2021