Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8313345

SuperWord fails due to CMove without matching Bool pack

    XMLWordPrintable

Details

    • b25
    • 21
    • b10
    • generic

    Backports

      Description

        After JDK-8306302, I'm encountering crashes on certain aarch64 systems:

        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        #  Internal Error (../../src/hotspot/share/opto/superword.cpp:2788), pid=2695887, tid=2695905
        #  assert(p_bol != nullptr) failed: CMove must have matching Bool pack
        #
        # JRE version: OpenJDK Runtime Environment (21.0.1) (slowdebug build 21.0.1-testing-builds.shipilev.net-openjdk-jdk21-b1-20230723)
        # Java VM: OpenJDK 64-Bit Server VM (slowdebug 21.0.1-testing-builds.shipilev.net-openjdk-jdk21-b1-20230723, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
        # Problematic frame:
        # V  [libjvm.so+0x14dc6ac]  SuperWord::output()+0xea8
        #
        # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/ubuntu/mc/debug_server/core.2695887)
        #
        # If you would like to submit a bug report, please visit:
        #   https://bugreport.java.com/bugreport/crash.jsp
        #

        ---------------  S U M M A R Y ------------

        Command Line: -Xmx8G -Xms4G -XX:PrintIdealGraphLevel=3 -XX:PrintIdealGraphFile=superword_crash.xml paper.jar --nogui

        Host: sirywell-vps, AArch64, 4 cores, 23G, Ubuntu 20.04.6 LTS
        Time: Wed Jul 26 19:30:34 2023 UTC elapsed time: 379.393956 seconds (0d 0h 6m 19s)

        ---------------  T H R E A D  ---------------

        Current thread (0x0000ffff1849a7b0):  JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=2695905, stack(0x0000ffff49d92000,0x0000ffff49f90000) (2040K)]


        Current CompileTask:
        C2: 379394 12918       4       net.minecraft.world.level.levelgen.DensityFunctions$PureTransformer::fillArray (40 bytes)

        Stack: [0x0000ffff49d92000,0x0000ffff49f90000],  sp=0x0000ffff49f8a530,  free space=2017k
        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V  [libjvm.so+0x14dc6ac]  SuperWord::output()+0xea8  (superword.cpp:2788)
        V  [libjvm.so+0x14d427c]  SuperWord::SLP_extract()+0x358  (superword.cpp:667)
        V  [libjvm.so+0x14d2934]  SuperWord::transform_loop(IdealLoopTree*, bool)+0x51c  (superword.cpp:178)
        V  [libjvm.so+0x10ceae0]  PhaseIdealLoop::build_and_optimize()+0x1724  (loopnode.cpp:4661)
        V  [libjvm.so+0x8eba44]  PhaseIdealLoop::PhaseIdealLoop(PhaseIterGVN&, LoopOptsMode)+0x148  (loopnode.hpp:1124)
        V  [libjvm.so+0x8ebc40]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x28  (loopnode.hpp:1203)
        V  [libjvm.so+0x8dc140]  Compile::optimize_loops(PhaseIterGVN&, LoopOptsMode)+0x8c  (compile.cpp:2156)
        V  [libjvm.so+0x8dce94]  Compile::Optimize()+0xbb4  (compile.cpp:2386)
        V  [libjvm.so+0x8d6348]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1138  (compile.cpp:842)
        V  [libjvm.so+0x798278]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x14c  (c2compiler.cpp:118)
        V  [libjvm.so+0x8f8388]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x768  (compileBroker.cpp:2265)
        V  [libjvm.so+0x8f71c8]  CompileBroker::compiler_thread_loop()+0x3c4  (compileBroker.cpp:1944)
        V  [libjvm.so+0x91c968]  CompilerThread::thread_entry(JavaThread*, JavaThread*)+0xa4  (compilerThread.cpp:58)
        V  [libjvm.so+0xd7bea8]  JavaThread::thread_main_inner()+0x174  (javaThread.cpp:719)
        V  [libjvm.so+0xd7bd28]  JavaThread::run()+0x1e4  (javaThread.cpp:704)
        V  [libjvm.so+0x1548cb4]  Thread::call_run()+0x1c4  (thread.cpp:217)
        V  [libjvm.so+0x1258b84]  thread_native_entry(Thread*)+0x194  (os_linux.cpp:778)
        C  [libpthread.so.0+0x7624]  start_thread+0x184

        I was able to reproduce this on OCI Ampere A1 Compute instances as well as on a Raspberry Pi 4 model B. It does not crash on Apple M1.

        While the crash above comes from a slowdebug build, normal builds (manually built from master at that point) fail with a SIGSEGV:



        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        #  SIGSEGV (0xb) at pc=0x0000ffff9847664c, pid=674132, tid=674405
        #
        # JRE version: OpenJDK Runtime Environment (22.0) (build 22-internal-adhoc.ubuntu.jdk)
        # Java VM: OpenJDK 64-Bit Server VM (22-internal-adhoc.ubuntu.jdk, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
        # Problematic frame:
        # V  [libjvm.so+0xd5664c]  SuperWord::vector_opd(Node_List*, int)+0x24
        #
        # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/ubuntu/mc/debug_server/core.674132)
        #
        # If you would like to submit a bug report, please visit:
        #   https://bugreport.java.com/bugreport/crash.jsp
        #

        ---------------  S U M M A R Y ------------

        Command Line: -Xmx8G -Xms4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Daikars.new.flags=true -Dusing.aikars.flags=https://mcflags.emc.gs -Djava.net.preferIPv4Stack=true -XX:NativeMemoryTracking=summary paper.jar --nogui

        Host: AArch64, 4 cores, 23G, Ubuntu 20.04.6 LTS
        Time: Sun Jul 23 07:26:29 2023 UTC elapsed time: 23.546695 seconds (0d 0h 0m 23s)

        ---------------  T H R E A D  ---------------

        Current thread (0x0000ffff207811d0):  JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=674405, stack(0x0000ffff601bf000,0x0000ffff603bd000) (2040K)]


        Current CompileTask:
        C2:  23546 11581 %     4       net.minecraft.world.level.levelgen.DensityFunctions$p::a @ 15 (40 bytes)

        Stack: [0x0000ffff601bf000,0x0000ffff603bd000],  sp=0x0000ffff603b7fc0,  free space=2019k
        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V  [libjvm.so+0xd5664c]  SuperWord::vector_opd(Node_List*, int)+0x24  (superword.cpp:2873)
        V  [libjvm.so+0xd5f528]  SuperWord::output()+0xd88  (superword.cpp:2652)
        V  [libjvm.so+0xa87f70]  PhaseIdealLoop::build_and_optimize()+0xe40  (loopnode.cpp:4656)
        V  [libjvm.so+0x5be40c]  Compile::Optimize()+0x994  (loopnode.hpp:1114)
        V  [libjvm.so+0x5bf90c]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0xbcc  (compile.cpp:850)
        V  [libjvm.so+0x4f5a48]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0xe0  (c2compiler.cpp:119)
        V  [libjvm.so+0x5c505c]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x9b4  (compileBroker.cpp:2265)
        V  [libjvm.so+0x5c7e0c]  CompileBroker::compiler_thread_loop()+0x57c  (compileBroker.cpp:1944)
        V  [libjvm.so+0x829234]  JavaThread::thread_main_inner() [clone .part.0]+0xa4  (javaThread.cpp:720)
        V  [libjvm.so+0xda6a60]  Thread::call_run()+0xa8  (thread.cpp:217)
        V  [libjvm.so+0xb97384]  thread_native_entry(Thread*)+0xdc  (os_linux.cpp:783)
        C  [libpthread.so.0+0x7624]  start_thread+0x184

        siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000010


        I sadly don't have a proper reproducer other than starting up a fresh minecraft server. My previous attempts weren't successful. I'll attach IGV graphs from the method that failed to compile (fillArray.xml).

        Let me know if there is more information I can provide.


        Attachments

          1. fillArray.xml
            1.26 MB
          2. hs_err_pid2695887.log
            222 kB
          3. replay_pid2695887.log
            1.94 MB
          4. Reproducer.java
            1 kB
          5. Reproducer2.java
            0.7 kB

          Issue Links

            Activity

              People

                thartmann Tobias Hartmann
                hgreule Hannes Greule
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: