[concurrency-interest] Question about final field semantic in case of a race

Aleksey Shipilev shade at redhat.com
Thu Aug 31 06:09:51 EDT 2017


On 08/31/2017 11:40 AM, Aleksey Shipilev wrote:
> String is published by race, but String.value is final, so it should be safe. Seeing NPE on
> dereferencing String.value is weird, and probably points to a compiler bug. Run with more modern
> JDK?. It is also not clear if you run ARMv7 or AArch64 VM (not all RPi 3 distros are 64-bit, and
> many identify RPi 3 as 32-bit ARM).

Pushed the variants of the test to jcstress, so they are picked up by vendor testing:
  http://hg.openjdk.java.net/code-tools/jcstress/rev/12d706400981

For sanity, booted up my RPi 3 with AArch64 distro, downloaded the AdoptOpenJDK build from here:
  https://github.com/AdoptOpenJDK/openjdk8-releases/releases/tag/jdk8u144-b01

And ran without failures:
 $ j2sdk-image/bin/java -jar jcstress.jar -t strings.Big

*** INTERESTING tests
  Some interesting behaviors observed. This is for the plain curiosity.

  0 matching test results.

*** FAILED tests
  Strong asserts were violated. Correct implementations should have no assert failures here.

  0 matching test results.

*** ERROR tests
  Tests break for some reason, other than failing the assert. Correct implementations should have none.

  0 matching test results.

*** All remaining tests
  Tests that do not fall into any of the previous categories.

  16 matching test results.  Use -v to print them.


Thanks,
-Aleksey


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20170831/5e3d5377/attachment-0001.sig>


More information about the Concurrency-interest mailing list