JDK-8271855 : [TESTBUG] Wrong weakCompareAndSet assumption in UnsafeIntrinsicsTest
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: ppc
  • Submitted: 2021-08-04
  • Updated: 2023-11-27
  • Resolved: 2021-09-29
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 17 JDK 18
17.0.2Fixed 18 b17Fixed
Related Reports
Relates :  
Description
The test UnsafeIntrinsicsTest can fail on PPC64 when testing new GCs. This platform has an optimized implementation of weakCompareAndSet.

According to [1], weakCompareAndSet is allowed to fail sporadically. Such sporadic failures are observable on PPC64.
[2] mentions memory contention as typical failure reason, but it's not the only possible reason. E.g., the OS can interrupt the Java Thread and the CPU can lose the reservation which also leads to such a failure. In addition, GC can access the same cache line concurrently, which is also a possible failure reason.

[1] https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicReference.html
[2] https://docs.oracle.com/javase/9/docs/api/java/lang/invoke/VarHandle.html#weakCompareAndSet-java.lang.Object...-
Comments
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. Applies cleanly.
15-10-2021

Changeset: c4d11570 Author: Martin Doerr <mdoerr@openjdk.org> Date: 2021-09-29 09:54:59 +0000 URL: https://git.openjdk.java.net/jdk/commit/c4d115701d102c33af937ca25dda8ac50117ac6b
29-09-2021

ILW = Intermittent test failure on PPC, only single test on a single platform, no workaround = MLH = P4
04-08-2021