[aarch64-port-dev ] 8u-aarch64: Backport 8171537: aarch64: compiler/c1/Test6849574.java generates guarantee failure in C1

Yangfei (Felix) felix.yang at huawei.com
Mon Aug 3 12:43:48 UTC 2020


Hi,

This 8u-aarch64 backport has been discussed and approved by aph before in:
    https://mail.openjdk.java.net/pipermail/aarch64-port-dev/2019-June/007463.html 

Bug: https://bugs.openjdk.java.net/browse/JDK-8171537 
Original jdk9 patch: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/a3bd5804b4be 
Original review thread: https://mail.openjdk.java.net/pipermail/aarch64-port-dev/2016-December/004036.html 

This bug is still reproducible with the following test (copied from test/hotspot/jtreg/compiler/c1/Test6849574.java in jdk9+):

$ cat Test6849574.java
import java.util.concurrent.atomic.AtomicReferenceArray;

public class Test6849574 extends Thread {

    public static void main(String[] args) {
        AtomicReferenceArray a = new AtomicReferenceArray(10000);
        for (int i = 0; i < 100000; i++) {
            a.getAndSet(9999, new Object());
            if (i > 99990) System.gc();
        }
    }
}

$ java -XX:TieredStopAtLevel=1 -XX:MaxInlineSize=50 Test6849574
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (assembler_aarch64.hpp:237), pid=2965, tid=0x0000fffebc4dd1e0
#  guarantee(val < (1U << nbits)) failed: Field too big for insn
#
# JRE version: OpenJDK Runtime Environment (8.0) (build 1.8.0-internal-yangfei_2020_08_03_20_20-b00)
# Java VM: OpenJDK 64-Bit Server VM (25.71-b00 mixed mode linux-aarch64 compressed oops)
# Core dump written. Default location: /home/yangfei/test/core or core.2965
......

8u-aarch64 backport is simpile:
diff -r e385349cb315 src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
--- a/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp    Fri Jul 08 17:11:37 2016 +0100
+++ b/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp    Mon Aug 03 20:36:04 2020 +0800
@@ -3145,7 +3145,7 @@
 }

 void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr dest, LIR_Opr tmp_op) {
-  Address addr = as_Address(src->as_address_ptr(), noreg);
+  Address addr = as_Address(src->as_address_ptr());
   BasicType type = src->type();
   bool is_oop = type == T_OBJECT || type == T_ARRAY;

Performed full jtreg test with aarch64 release build.  Please take another look.

Thanks,
Felix


More information about the aarch64-port-dev mailing list