C2 VectorAPI: failed: there should be an oop in OopMap instead of a live raw oop at safepoint

XMLWordPrintable

    • b21
    • 16
    • aarch64

      Found while writing benchmarks and tests JDK-8373026.

      So far I only was able to reproduce it on aarch64 NEON, and so far no luck on x64 (AVX512, AVX2, AVX), but we need to confirm that once we have done some basic analysis. I would not be surprised if we could get it to crash on other platforms, by restricting the intrinsics in the right way.

      java -XX:MaxVectorSize=8 Test.java

        354 Phi === 144 1682 356 [[ 455 353 ]] #rawptr:BotPTR !jvms: IntVector::reduceLanesTemplate @ bci:78 (line 2840) Int64Vector::reduceLanes @ bci:2 (line 330) Test::findMinIndexI_VectorAPI @ bci:147 (line 33)
        354 Phi === 144 1682 356 [[ 455 353 ]] #rawptr:BotPTR !jvms: IntVector::reduceLanesTemplate @ bci:78 (line 2840) Int64Vector::reduceLanes @ bci:2 (line 330) Test::findMinIndexI_VectorAPI @ bci:147 (line 33)
        139 safePoint === 142 0 457 0 0 140 1399 458 459 460 281 0 0 0 0 1408 1404 1405 [[ 141 958 1132 ]] !jvms: Test::findMinIndexI_VectorAPI @ bci:113 (line 23)

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/home/opc/jdk-fork0/open/src/hotspot/share/opto/buildOopMap.cpp:371), pid=187550, tid=187584
      # assert(false) failed: there should be an oop in OopMap instead of a live raw oop at safepoint
      #
      # JRE version: Java(TM) SE Runtime Environment (27.0) (fastdebug build 27-internal-opc.open)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 27-internal-opc.open, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
      # Problematic frame:
      # V [libjvm.so+0x6dcf48] OopFlow::build_oop_map(Node*, int, PhaseRegAlloc*, int*)+0xfdc
      #
      # Core dump will be written. Default location: Determined by the following: "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %d %F" (alternatively, falling back to /home/opc/jdk-fork0/build/linux-aarch64-debug/jdk/bin/core.187550)
      #
      # 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: -XX:MaxVectorSize=8 --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher Test.java

      Host: ???, AArch64, 12 cores, 30G, Oracle Linux Server release 9.7
      Time: Fri Jan 23 11:06:44 2026 GMT elapsed time: 6.889318 seconds (0d 0h 0m 6s)

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

      Current thread (0x0000ffff483f6d40): JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=187584, stack(0x0000ffff8146e000,0x0000ffff8166c000) (2040K)]


      Current CompileTask:
      C2:6889 2232 % 4 Test::findMinIndexI_VectorAPI @ 33 (189 bytes)

      Stack: [0x0000ffff8146e000,0x0000ffff8166c000], sp=0x0000ffff81667080, free space=2020k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x6dcf48] OopFlow::build_oop_map(Node*, int, PhaseRegAlloc*, int*)+0xfdc (buildOopMap.cpp:371)
      V [libjvm.so+0x6ddbd0] OopFlow::compute_reach(PhaseRegAlloc*, int, Dict*)+0x1f0 (buildOopMap.cpp:121)
      V [libjvm.so+0x6df9a8] PhaseOutput::BuildOopMaps()+0x1748 (buildOopMap.cpp:713)
      V [libjvm.so+0x15885c8] PhaseOutput::Output()+0xa08 (output.cpp:343)
      V [libjvm.so+0x9ea3d8] Compile::Code_Gen()+0x7f8 (compile.cpp:3137)
      V [libjvm.so+0x9ee514] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1768 (compile.cpp:895)
      V [libjvm.so+0x815a18] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x2d4 (c2compiler.cpp:147)
      V [libjvm.so+0x9fd1cc] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb08 (compileBroker.cpp:2345)
      V [libjvm.so+0x9fe0f8] CompileBroker::compiler_thread_loop()+0x638 (compileBroker.cpp:1989)
      V [libjvm.so+0xf075a8] JavaThread::thread_main_inner()+0x108 (javaThread.cpp:776)
      V [libjvm.so+0x188fd4c] Thread::call_run()+0xac (thread.cpp:242)
      V [libjvm.so+0x155dcdc] thread_native_entry(Thread*)+0x11c (os_linux.cpp:860)
      C [libc.so.6+0x80e10] start_thread+0x300

        1. hs_err_pid187550.log
          152 kB
          Emanuel Peter
        2. Reduced.java
          0.6 kB
          Emanuel Peter
        3. replay_pid187550.log
          378 kB
          Emanuel Peter
        4. Test.java
          1 kB
          Emanuel Peter

            Assignee:
            Unassigned
            Reporter:
            Emanuel Peter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: