JDK-8351950 : C2: AVX512 vector assembler routines causing SIGFPE / no valid evex tuple_table entry
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 18,21,24,25
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-03-13
  • Updated: 2025-05-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25Unresolved
Related Reports
Causes :  
Description
I found this with the Template Framework JDK-8344942.

java --add-modules=jdk.incubator.vector -Xbatch -XX:UseAVX=3 Test.java

Does not seem to reproduce with AVX2.

Product: SIGFPE (probably the modulo on line 447 below).
Debug: assert

This is the relevant code snippet:

    440     default:
    441       assert(0, "no valid evex tuple_table entry");
    442       break;
    443     }
    444 
    445     if (vector_len >= AVX_128bit && vector_len <= AVX_512bit) {
    446       int disp_factor = tuple_table[cur_tuple_type + mod_idx][vector_len];
    447       if ((disp % disp_factor) == 0) {


#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/oracle-work/jdk-fork0/open/src/hotspot/cpu/x86/assembler_x86.cpp:531), pid=2508584, tid=2508598
#  assert(0) failed: no valid evex tuple_table entry
#
# JRE version: Java(TM) SE Runtime Environment (25.0) (fastdebug build 25-internal-LTS-2025-03-11-0926490.emanuel...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 25-internal-LTS-2025-03-11-0926490.emanuel..., mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x64e453]  Assembler::emit_compressed_disp_byte(int&)+0x163
#
# 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 /oracle-work/jdk-fork0/build/linux-x64-debug/jdk/bin/core.2508584)
#
# An error report file with more information is saved as:
# /oracle-work/jdk-fork0/build/linux-x64-debug/jdk/bin/hs_err_pid2508584.log
#
# Compiler replay data is saved as:
# /oracle-work/jdk-fork0/build/linux-x64-debug/jdk/bin/replay_pid2508584.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
Aborted (core dumped)

Current CompileTask:
C2:11948 2199    b  4       Test::test (31 bytes)

Stack: [0x0000786e04200000,0x0000786e04300000],  sp=0x0000786e042fb4d0,  free space=1005k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x64e453]  Assembler::emit_compressed_disp_byte(int&)+0x163  (assembler_x86.cpp:531)
V  [libjvm.so+0x64f6fc]  Assembler::emit_operand_helper(int, int, int, Address::ScaleFactor, int, RelocationHolder const&, int)+0x21c  (assembler_x86.cpp:653)
V  [libjvm.so+0x64fe53]  Assembler::emit_operand(XMMRegister, Address, int) [clone .constprop.0]+0x43  (assembler_x86.cpp:1326)
V  [libjvm.so+0x6bad9a]  Assembler::evpminsw(XMMRegister, KRegister, XMMRegister, Address, bool, int)+0x1fa  (assembler_x86.cpp:12251)
V  [libjvm.so+0x1442f38]  MacroAssembler::evpmins(BasicType, XMMRegister, KRegister, XMMRegister, Address, bool, int)+0xb8  (macroAssembler_x86.cpp:9968)
V  [libjvm.so+0x8a5cc3]  C2_MacroAssembler::evmasked_op(int, BasicType, KRegister, XMMRegister, XMMRegister, Address, bool, int)+0x283  (c2_MacroAssembler_x86.cpp:4972)
V  [libjvm.so+0x449a78]  vminv_mem_maskedNode::emit(C2_MacroAssembler*, PhaseRegAlloc*) const+0x288  (x86.ad:10350)
V  [libjvm.so+0x161b95e]  PhaseOutput::scratch_emit_size(Node const*)+0x49e  (output.cpp:3385)
V  [libjvm.so+0x1613b22]  PhaseOutput::shorten_branches(unsigned int*)+0x382  (output.cpp:539)
V  [libjvm.so+0x1625e36]  PhaseOutput::Output()+0xa36  (output.cpp:339)
V  [libjvm.so+0xa7f124]  Compile::Code_Gen()+0xa14  (compile.cpp:3081)
V  [libjvm.so+0xa8430f]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1fcf  (compile.cpp:891)
V  [libjvm.so+0x8c3d00]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x440  (c2compiler.cpp:141)
V  [libjvm.so+0xa91cec]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xbfc  (compileBroker.cpp:2331)
V  [libjvm.so+0xa92c28]  CompileBroker::compiler_thread_loop()+0x598  (compileBroker.cpp:1975)
V  [libjvm.so+0xf7eb0f]  JavaThread::thread_main_inner()+0x12f  (javaThread.cpp:776)
V  [libjvm.so+0x1947b56]  Thread::call_run()+0xb6  (thread.cpp:231)
V  [libjvm.so+0x15fa1b8]  thread_native_entry(Thread*)+0x128  (os_linux.cpp:877)
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25021 Date: 2025-05-03 15:49:24 +0000
12-05-2025

Draft PR for fix in place. https://github.com/openjdk/jdk/pull/25021 Need to improve the test before opening for review.
03-05-2025

Paging [~jbhateja]
13-03-2025

ILW = Assert / crash during C2 compilation, single test using Vector API (incubator) with AVX-512, don't use AVX-512 or disable compilation of affected method = HLM = P3
13-03-2025

Crashes in product: # A fatal error has been detected by the Java Runtime Environment: # # SIGFPE (0x8) at pc=0x00007f5f9d43548d, pid=2542621, tid=2542645 # # JRE version: Java(TM) SE Runtime Environment (21.0.4+3) (build 21.0.4-ea+3-LTS-234) # Java VM: Java HotSpot(TM) 64-Bit Server VM (21.0.4-ea+3-LTS-234, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x43548d] Assembler::emit_compressed_disp_byte(int&)+0x6d Current CompileTask: C2: 31242 1635 b 4 Test::test (31 bytes) Stack: [0x00007f5efe800000,0x00007f5efe900000], sp=0x00007f5efe8fbd08, free space=1007k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x43548d] Assembler::emit_compressed_disp_byte(int&)+0x6d V [libjvm.so+0x451256] Assembler::evpminsw(XMMRegister, KRegister, XMMRegister, Address, bool, int)+0x176 V [libjvm.so+0xbed282] MacroAssembler::evpmins(BasicType, XMMRegister, KRegister, XMMRegister, Address, bool, int)+0xb2 V [libjvm.so+0x56b650] C2_MacroAssembler::evmasked_op(int, BasicType, KRegister, XMMRegister, XMMRegister, Address, bool, int)+0x180 V [libjvm.so+0x35f0ca] vminv_mem_maskedNode::emit(CodeBuffer&, PhaseRegAlloc*) const+0x22a V [libjvm.so+0xcdfacf] PhaseOutput::scratch_emit_size(Node const*)+0x28f V [libjvm.so+0xcdbb17] PhaseOutput::shorten_branches(unsigned int*)+0x257 V [libjvm.so+0xce393a] PhaseOutput::Output()+0x4ea V [libjvm.so+0x64412e] Compile::Code_Gen()+0x59e V [libjvm.so+0x647ff4] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1584 V [libjvm.so+0x574d2d] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x17d V [libjvm.so+0x64d7b7] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa97 V [libjvm.so+0x6508a8] CompileBroker::compiler_thread_loop()+0x6a8 V [libjvm.so+0x8fd8f8] JavaThread::thread_main_inner() [clone .part.0]+0xb8 V [libjvm.so+0xea7f98] Thread::call_run()+0xa8 V [libjvm.so+0xccaf2a] thread_native_entry(Thread*)+0xda
13-03-2025

Regression from JDK-8271515 in JDK 18 b24.
13-03-2025