AArch64: Match rule failure with some CompareAndSwap operand shapes

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 26
    • Affects Version/s: 9
    • Component/s: hotspot
    • master

      Following up on JDK-8371959 failures, I managed to reproduce the "bad AD" file assert. It is heavily intermittent, and needs hours of runs before we hit the lucky seed, plus JDK-8360557 to have broader testing scope.

      % CONF=linux-aarch64-server-fastdebug make test TEST=applications/ctw/modules/java_base.java TEST_VM_OPTS="-ea -esa -XX:-TieredCompilation -XX:-UseCompressedOops -XX:MaxInlineSize=50 -Djdk.test.lib.random.seed=-7495793528766538863"

      java.lang.Error: modules_java_base_0: failed during compilation of class #752 : java/lang/VirtualThread
              at sun.hotspot.tools.ctw.CtwRunner.startCtwforAllClasses(CtwRunner.java:231)
              at sun.hotspot.tools.ctw.CtwRunner.run(CtwRunner.java:129)
              at sun.hotspot.tools.ctw.CtwRunner.main(CtwRunner.java:75)
              at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
              at java.base/java.lang.reflect.Method.invoke(Method.java:565)
              at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:335)
              at java.base/java.lang.Thread.run(Thread.java:1516)

      # Internal Error (/home/shipilev/shipilev-jdk/src/hotspot/share/opto/matcher.cpp:1641), pid=21871, tid=22614
      # assert(false) failed: bad AD file
      #

      Current CompileTask:
      C2:16943 7172 !b java.lang.VirtualThread::unpark (130 bytes)

      Stack: [0x0000fffe7340c000,0x0000fffe7360a000], sp=0x0000fffe73605480, free space=2021k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x144dc3c] Matcher::Label_Root(Node const*, State*, Node*, Node*&)+0x83c (matcher.cpp:1641)
      V [libjvm.so+0x144dd88] Matcher::match_tree(Node const*)+0xe8 (matcher.cpp:1425)
      V [libjvm.so+0x1453218] Matcher::xform(Node*, int)+0xdb0 (matcher.cpp:1041)
      V [libjvm.so+0x1456190] Matcher::match()+0x8f0 (matcher.cpp:338)
      V [libjvm.so+0xa4d41c] Compile::Code_Gen()+0x90 (compile.cpp:3032)
      V [libjvm.so+0xa518c0] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x17d8 (compile.cpp:893)
      V [libjvm.so+0x88e018] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x174 (c2compiler.cpp:147)
      V [libjvm.so+0xa5ef84] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb58 (compileBroker.cpp:2345)
      V [libjvm.so+0xa5fb04] CompileBroker::compiler_thread_loop()+0x504 (compileBroker.cpp:1989)
      V [libjvm.so+0xf81a4c] JavaThread::thread_main_inner()+0xec (javaThread.cpp:776)
      V [libjvm.so+0x1a94218] Thread::call_run()+0xb0 (thread.cpp:242)
      V [libjvm.so+0x15b91a8] thread_native_entry(Thread*)+0x128 (os_linux.cpp:877)
      C [libpthread.so.0+0x7230] start_thread+0xb0
      o179 CompareAndSwapI === o176 o177 o992 o1031 [[ o180 o185 o190 20 22 136 ]]

      --N: o179 CompareAndSwapI === o176 o177 o992 o1031 [[ o180 o185 o190 20 22 136 ]]

         --N: o992 AddP === _ o10 o10 o121 [[ o407 o179 o971 ]] Oop:java/lang/VirtualThread (java/lang/Runnable):NotNull:exact+60 *
         IREGP 0 IREGP
         IREGPNOSP 0 IREGPNOSP
         IREGPNOSPNORFP 0 IREGPNOSPNORFP
         IREGP_R0 0 IREGP_R0
         IREGP_R1 0 IREGP_R1
         IREGP_R2 0 IREGP_R2
         IREGP_R3 0 IREGP_R3
         IREGP_R4 0 IREGP_R4
         IREGP_R5 0 IREGP_R5
         IREGP_R10 0 IREGP_R10
         INLINE_CACHE_REGP 0 INLINE_CACHE_REGP
         THREAD_REGP 0 THREAD_REGP
         INDIRECT 0 INDIRECT
         VMEM2 0 INDIRECT
         VMEM4 0 INDIRECT
         VMEM8 0 INDIRECT
         VMEM16 0 INDIRECT
         MEMORY1 0 INDIRECT
         MEMORY2 0 INDIRECT
         MEMORY4 0 INDIRECT
         MEMORY8 0 INDIRECT
         MEMORY 0 INDIRECT
         IREGPORL2P 0 IREGP
         VMEMA 0 INDIRECT

         --N: o1031 Binary === _ o525 o149 [[ o179 ]]
         _Binary_iRegI_iRegI 100 _Binary_iRegI_iRegI
         _Binary_iRegIorL2I_iRegIorL2I 100 _Binary_iRegIorL2I_iRegIorL2I

            --N: o525 CastII === o137 o971 [[ o1031 ]] #int:>=0, widen: 3 extra types: {0:int:4, 1:int:7} strong dependency
            IREGI 0 castII
            IREGIORL2I 0 IREGI

               --N: o971 LoadI === _ o908 o992 [[ o139 o129 o525 o526 ]] @java/lang/VirtualThread (java/lang/Runnable):exact+60 *, name=state, idx=6; Volatile! #int
               IREGI 0 IREGI
               IREGINOSP 0 IREGINOSP
               IREGI_R0 0 IREGI_R0
               IREGI_R2 0 IREGI_R2
               IREGI_R3 0 IREGI_R3
               IREGI_R4 0 IREGI_R4
               IREGIORL2I 0 IREGI

            --N: o149 ConI === o0 [[ o1031 ]] #int:9
            IMMI 0 IMMI
            IMMI_GT_1 0 IMMI_GT_1
            IMMI_POSITIVE 0 IMMI_POSITIVE
            IMMI_CMP_COND 0 IMMI_CMP_COND
            IMMI5 0 IMMI5
            IMMIU7 0 IMMIU7
            IMMIOFFSET 0 IMMIOFFSET
            IMMIOFFSET1 0 IMMIOFFSET1
            IMMIOFFSET2 0 IMMIOFFSET2
            IMMIOFFSET4 0 IMMIOFFSET4
            IMMIOFFSET8 0 IMMIOFFSET8
            IMMIOFFSET16 0 IMMIOFFSET16
            IMMI8 0 IMMI8
            IMMIDUPV 0 IMMIDUPV
            IMMBADDSUBV 0 IMMBADDSUBV
            IMMIADDSUB 0 IMMIADDSUB
            IMMIADDSUBV 0 IMMIADDSUBV
            IREGI 100 loadConI
            IREGINOSP 100 loadConI
            IREGI_R0 100 loadConI
            IREGI_R2 100 loadConI
            IREGI_R3 100 loadConI
            IREGI_R4 100 loadConI
            IREGIORL2I 100 IREGI

            Assignee:
            Aleksey Shipilev
            Reporter:
            Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: