[lworld] RFR: 8264414: [lworld] [AArch64] TestBufferTearing.java fails with C1 [v2]

Nick Gasson ngasson at openjdk.java.net
Fri Apr 9 06:33:18 UTC 2021


> We see failures like this on AArch64 when MyValue.incrementAndCheck() is
> compiled with C1:
> 
>   java.lang.RuntimeException: Inconsistent field values: expected 0 to equal 675128
>         at jdk.test.lib.Asserts.fail(Asserts.java:594)
>         at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
>         at jdk.test.lib.Asserts.assertEQ(Asserts.java:178)
>         at compiler.valhalla.inlinetypes.MyValue.incrementAndCheck(TestBufferTearing.java:81)
>         at compiler.valhalla.inlinetypes.TestBufferTearing$Runner.run(TestBufferTearing.java:124)
> 
> The barrier that is usually inserted on return from a method that wrote
> final fields should be sufficient to prevent another thread seeing the
> zero-initialised intermediate state.  However this barrier isn't
> inserted at the moment because method()->is_object_constructor() is
> false for primitive class constructors.
> 
> C2 has a similar guard around the memory barrier in Parse::do_exits().
> I'm not sure if that needs amending as well but I've not seen any
> failures due to it.

Nick Gasson has updated the pull request incrementally with one additional commit since the last revision:

  Two more missing membars

-------------

Changes:
  - all: https://git.openjdk.java.net/valhalla/pull/376/files
  - new: https://git.openjdk.java.net/valhalla/pull/376/files/afed1e02..ed4c8bd2

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=valhalla&pr=376&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=valhalla&pr=376&range=00-01

  Stats: 122 lines in 2 files changed: 122 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/376.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/376/head:pull/376

PR: https://git.openjdk.java.net/valhalla/pull/376


More information about the valhalla-dev mailing list