C2 VectorAPI: assert((is_integral_type(bt) && bt != T_LONG) || is_signed) failed

XMLWordPrintable

      Found while working on JDK-8369699.

      Sadly, I could not yet remove it from JTREG / Testing Framework.
      I think this could be due to profiling / warmup / forced compilation from Testing Framework.

      I ran this on my AVX512 machine, but it also seems to reproduce with AVX2.

      /home/empeter/Documents/oracle/jtreg/bin/jtreg -va -s -jdk:/home/empeter/Documents/oracle/jdk-fork3/build/linux-x64-debug/jdk -javaoptions:"-DShuffleTests=false -XX:-TieredCompilation -Xbatch -XX:UseAVX=2" -J-Djavatest.maxOutputSize=10000000 /home/empeter/Documents/oracle/jdk-fork3/open/test/hotspot/jtreg/compiler/vectorapi/Fuzzed.java

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/home/empeter/Documents/oracle/jdk-fork3/open/src/hotspot/share/opto/vectornode.cpp:1491), pid=2146176, tid=2146192
      # Error: assert((is_integral_type(bt) && bt != T_LONG) || is_signed) failed
      #
      # JRE version: Java(TM) SE Runtime Environment (27.0) (fastdebug build 27-internal-empeter.open)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 27-internal-empeter.open, mixed mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x1c659cc] VectorCastNode::opcode(int, BasicType, bool)+0x20c
      [empeter@emanuel bin]$ head -n 50 /home/empeter/Documents/oracle/jdk-fork3/build/linux-x64-debug/jdk/bin/JTwork/scratch/hs_err_pid2146176.log
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/home/empeter/Documents/oracle/jdk-fork3/open/src/hotspot/share/opto/vectornode.cpp:1491), pid=2146176, tid=2146192
      # Error: assert((is_integral_type(bt) && bt != T_LONG) || is_signed) failed
      #
      # JRE version: Java(TM) SE Runtime Environment (27.0) (fastdebug build 27-internal-empeter.open)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 27-internal-empeter.open, mixed mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x1c659cc] VectorCastNode::opcode(int, BasicType, bool)+0x20c
      #
      # 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/empeter/Documents/oracle/jdk-fork3/build/linux-x64-debug/jdk/bin/JTwork/scratch/core.2146176)
      #
      # 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: -Djava.library.path=. -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -DShuffleTests=false -XX:-TieredCompilation -Xbatch -XX:UseAVX=2 -Dir.framework.server.port=40583 -XX:-BackgroundCompilation -XX:CompileCommand=quiet compiler.lib.ir_framework.test.TestVM compiler.vectorapi.Fuzzed

      Host: emanuel.peter, 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz, 16 cores, 29G, Oracle Linux Server release 9.7
      Time: Fri Jan 9 12:49:36 2026 CET elapsed time: 1.367873 seconds (0d 0h 0m 1s)

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

      Current thread (0x00007fb0401d17e0): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=2146192, stack(0x00007fb0305ed000,0x00007fb0306ed000) (1024K)]


      Current CompileTask:
      C2:1367 501 b compiler.vectorapi.Fuzzed::test2 (36 bytes)

      Stack: [0x00007fb0305ed000,0x00007fb0306ed000], sp=0x00007fb0306e7860, free space=1002k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x1c659cc] VectorCastNode::opcode(int, BasicType, bool)+0x20c (vectornode.cpp:1491)
      V [libjvm.so+0x1c45c9c] LibraryCallKit::inline_vector_convert()+0x95c (vectorIntrinsics.cpp:2333)
      V [libjvm.so+0x1534bd0] LibraryIntrinsic::generate(JVMState*)+0x230 (library_call.cpp:120)
      V [libjvm.so+0x9d5583] CallGenerator::do_late_inline_helper()+0xa63 (callGenerator.cpp:675)
      V [libjvm.so+0xbad55f] Compile::inline_incrementally_one()+0x1af (compile.cpp:2119)
      V [libjvm.so+0xbaec8b] Compile::inline_incrementally(PhaseIterGVN&)+0x37b (compile.cpp:2212)
      V [libjvm.so+0xbb178e] Compile::Optimize()+0x47e (compile.cpp:2344)
      V [libjvm.so+0xbb5173] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x2023 (compile.cpp:862)
      V [libjvm.so+0x9cc3e8] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x498 (c2compiler.cpp:147)
      V [libjvm.so+0xbc4660] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x780 (compileBroker.cpp:2345)
      V [libjvm.so+0xbc5ec0] CompileBroker::compiler_thread_loop()+0x530 (compileBroker.cpp:1989)
      V [libjvm.so+0x112635b] JavaThread::thread_main_inner()+0x13b (javaThread.cpp:776)
      V [libjvm.so+0x1bb26f6] Thread::call_run()+0xb6 (thread.cpp:242)
      V [libjvm.so+0x18082d8] thread_native_entry(Thread*)+0x118 (os_linux.cpp:860)

        1. Fuzzed.java
          2 kB
          Emanuel Peter
        2. hs_err_pid2146176.log
          78 kB
          Emanuel Peter
        3. replay_pid2146176.log
          347 kB
          Emanuel Peter

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

              Created:
              Updated: