JDK-8281544 : assert(VM_Version::supports_avx512bw()) failed for Tests jdk/incubator/vector/
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18,19
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-02-09
  • Updated: 2022-04-04
  • Resolved: 2022-02-21
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 17 JDK 18 JDK 19
17.0.4-oracleFixed 18.0.2Fixed 19 b11Fixed
Related Reports
Relates :  
Description
Running jdk/incubator/vector/ Tests with JVM Flags

-XX:UseAVX=3 -XX:+UnlockDiagnosticVMOptions -XX:+UseKNLSetting -XX:+UnlockExperimentalVMOptions -XX:+UseZGC

triggers this assert from src/hotspot/cpu/x86/assembler_x86.cpp.
When reproducing this make sure the machine has AVX3 support, else the code automatically reverts to AVX2 and does not end up triggering the assert.

In particular, I have seen these tests fail:
jdk/incubator/vector/VectorMaxConversionTests.java
jdk/incubator/vector/Vector512ConversionTests.java
jdk/incubator/vector/Vector256ConversionTests.java
jdk/incubator/vector/Vector128ConversionTests.java
jdk/incubator/vector/Long512VectorTests.java
jdk/incubator/vector/Long512VectorLoadStoreTests.java
jdk/incubator/vector/Int512VectorTests.java
jdk/incubator/vector/Int512VectorLoadStoreTests.java
jdk/incubator/vector/Float512VectorTests.java
jdk/incubator/vector/Float512VectorLoadStoreTests.java
jdk/incubator/vector/Double512VectorTests.java
jdk/incubator/vector/Double512VectorLoadStoreTests.java


#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (src/hotspot/cpu/x86/assembler_x86.cpp:2577), pid=21597, tid=21784
#  Error: assert(VM_Version::supports_avx512bw()) failed
#
# JRE version: Java(TM) SE Runtime Environment (19.0) (fastdebug build 19-internal+0-2022-02-09-1405029.emanuel.peter.jdk)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 19-internal+0-2022-02-09-1405029.emanuel.peter.jdk, mixed mode, sharing, compressed class ptrs, z gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x6a44f4]  Assembler::kmovql(Address, KRegisterImpl*)+0x194
#
# Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to xxx)
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#


Current CompileTask:
C2:   6215 1774             jdk.incubator.vector.FloatVector$FloatSpecies::maskAll (88 bytes)

Stack: [0x00007efd83afa000,0x00007efd83bfb000],  sp=0x00007efd83bf5870,  free space=1006k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x6a44f4]  Assembler::kmovql(Address, KRegisterImpl*)+0x194
V  [libjvm.so+0x1aaf4b8]  ZSaveLiveRegisters::ZSaveLiveRegisters(MacroAssembler*, ZLoadBarrierStubC2*)+0x578
V  [libjvm.so+0x1aa2291]  ZBarrierSetAssembler::generate_c2_load_barrier_stub(MacroAssembler*, ZLoadBarrierStubC2*) const+0x51
V  [libjvm.so+0x1ab2332]  ZBarrierSetC2::emit_stubs(CodeBuffer&) const+0x112
V  [libjvm.so+0x164d38c]  PhaseOutput::fill_buffer(CodeBuffer*, unsigned int*)+0x2d6c
V  [libjvm.so+0xa9672b]  Compile::Code_Gen()+0x42b
V  [libjvm.so+0xa9bfcb]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x164b
V  [libjvm.so+0x8b29f9]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x669
V  [libjvm.so+0xaabdd8]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xc88
V  [libjvm.so+0xaacbb8]  CompileBroker::compiler_thread_loop()+0x668
V  [libjvm.so+0x193867a]  JavaThread::thread_main_inner()+0x25a
V  [libjvm.so+0x19409c0]  Thread::call_run()+0x100
V  [libjvm.so+0x1623cb4]  thread_native_entry(Thread*)+0x104
Comments
A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk18u/pull/66 Date: 2022-03-29 15:22:58 +0000
29-03-2022

Fix Request (JDK 18u) Fixes an assert in C2. The fix is low risk and applies cleanly. Already tested and backported to Oracle JDK 17u. Tier 1-3 testing is running for JDK 18u.
29-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk17u-dev/pull/299 Date: 2022-03-29 13:12:37 +0000
29-03-2022

Fix Request (17u): Should get backported for parity with 17.0.4-oracle. Applies cleanly. Test has passed.
29-03-2022

Changeset: 4e0b81c5 Author: Emanuel Peter <emanuel.peter@oracle.com> Committer: Tobias Hartmann <thartmann@openjdk.org> Date: 2022-02-21 07:05:04 +0000 URL: https://git.openjdk.java.net/jdk/commit/4e0b81c596f2a2eae49127b9ee98c80500b4e319
21-02-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7510 Date: 2022-02-17 07:51:42 +0000
17-02-2022

Running the tests with flags -XX:UseAVX=3 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseZGC and simulating Knights Landing with "sde -knl" (IntelĀ® Software Development Emulator) also reproduces the bug. Suggested solution: replace "Assembler::kmovql" with "MacroAssembler::kmov", which internally choses either "kmovql" (if avx512bw enabled), else "kmovwl". This is analogous to the use in "RegisterSaver::save_live_registers", which seems to perform a similar task to our function "ZSaveLiveRegisters::ZSaveLiveRegisters" (see "ZSaveLiveRegisters::initialize").
16-02-2022

-XX:UseAVX=3 enables AVX512 in general. The machine that the test was run on does support AVX3 (AVX512), and even the BW subset of instructions. However, -XX:+UseKNLSetting makes is_knights_family() return true, which eventually disables CPU_AVX512BW.
15-02-2022

The difference from our regular CI testing is using -XX:+UseZGC flag. And call stack shows that it is GC barrier code.
11-02-2022

ILW = vector test assert with debug build = MMH = P3
10-02-2022