[aarch64-port-dev ] 8233839: aarch64: missing memory barrier in NewObjectArrayStub and NewTypeArrayStub
Andrew Dinn
adinn at redhat.com
Fri Nov 8 09:04:08 UTC 2019
On 08/11/2019 08:30, Yangfei (Felix) wrote:
> I witnessed random fail of one jcstress test on my 128-core aarch64 server: "org.openjdk.jcstress.tests.defaultValues.arrays.small.plain.StringTest"
> Bug: https://bugs.openjdk.java.net/browse/JDK-8233839
>
> I used the latest aarch64 jdk8u release build. Please refer to the bugzilla for details and the analysis.
> I checked the assembler code emitted by LIR_Assembler::emit_alloc_array:
> For the fast path, the StoreStore memory barrier is there. But it’s not the case for the slow path.
>
> Patch adding the missing barrier for 14:
>
> diff -r ad157fab6bf5 src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp
> --- a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp Thu Nov 07 16:26:57 2019 -0800
> +++ b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp Fri Nov 08 16:10:08 2019 +0800
> @@ -840,6 +840,7 @@
> __ sub(arr_size, arr_size, t1); // body length
> __ add(t1, t1, obj); // body start
> __ initialize_body(t1, arr_size, 0, t2);
> + __ membar(Assembler::StoreStore);
> __ verify_oop(obj);
>
> __ ret(lr);
>
> JDK builds OK and passed tier1 test.
Very nice detective work finding that one!
The jdk14 patch looks good. Also the same patch for jdk11 and the
variant for jdk8 are good.
regards,
Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill
More information about the aarch64-port-dev
mailing list