JDK-8253284 : Zero OrderAccess barrier mappings are incorrect
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8,11,15,16
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-09-17
  • Updated: 2021-01-13
  • Resolved: 2020-09-22
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 15 JDK 16 Other
11.0.10Fixed 15.0.2Fixed 16 b17Fixed openjdk8u282Fixed
Related Reports
Relates :  
Relates :  
Description
This happens at least on linux-zero-aarch64:

$ shipilev-jdk/build/linux-aarch64-zero-release/images/jdk/bin/java -jar jcstress-latest.jar -m quick --jvmArgs "-Xint" -sc 64 -t memeffects.basic.volatiles

org.openjdk.jcstress.tests.memeffects.basic.volatiles.volatile_byte_double [-Xint]: Observed forbidden state: 1, 0.0 (Seeing set guard, not seeing the updated value)
org.openjdk.jcstress.tests.memeffects.basic.volatiles.volatile_int_long [-Xint]: Observed forbidden state: 42, 0 (Seeing set guard, not seeing the updated value)
org.openjdk.jcstress.tests.memeffects.basic.volatiles.volatile_boolean_double [-Xint]: Observed forbidden state: true, 0.0 (Seeing set guard, not seeing the updated value)
org.openjdk.jcstress.tests.memeffects.basic.volatiles.volatile_char_long [-Xint]: Observed forbidden state: A, 0 (Seeing set guard, not seeing the updated value)

...and it seems to happen because orderAccess_linux_zero.hpp defaults to compiler-only barriers for most OrderAccess::* calls.
Comments
Fix Request (8u) Same reason as 11u and 15u, but patch needs to be reworked. 8u RFR (acked by aph): https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-October/012785.html
13-10-2020

Fix Request (15u) Same reason as for 11u.
07-10-2020

Fix Request (11u) Without this patch, AArch64 Zero is broken, and probably other Zero configurations except listed explicitly in defines. Patch applies cleanly to 11u, passes jcstress "memeffects.basic.volatiles" with the patch, fails without it.
07-10-2020

Changeset: b9729cb4 Author: Aleksey Shipilev <shade@openjdk.org> Date: 2020-09-22 08:33:42 +0000 URL: https://git.openjdk.java.net/jdk/commit/b9729cb4
22-09-2020

The code was changed a bit with JDK-7143664, but previous iteration in 8u also has the similar issue: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-September/012704.html
17-09-2020