A DESCRIPTION OF THE PROBLEM :
JVM crashed when I run SPECjvm. No errors are reported when running in JDK11, but when running in JDK17, JVM crashed.
Reproduce: java -jar -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:-IdealizeClearArrayNode SPECjvm2008.jar startup.sunflow -ikv
hs_err log:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (codeBuffer.cpp:973), pid=21701, tid=21743
# guarantee(sect->end() <= sect->limit()) failed: sanity
#
# JRE version: Java(TM) SE Runtime Environment (17.0.2+8) (build 17.0.2+8-LTS-86)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.2+8-LTS-86, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x574704] CodeBuffer::verify_section_allocation()+0x204
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /home/jiahx/SPECjvm2008/core.21701)
#
# 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: -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:-IdealizeClearArrayNode SPECjvm2008.jar startup.sunflow -ikv
Host: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz, 16 cores, 31G, Ubuntu 18.04.6 LTS
Time: Wed Mar 30 16:43:38 2022 CST elapsed time: 4.418891 seconds (0d 0h 0m 4s)
--------------- T H R E A D ---------------
Current thread (0x00007fc744178730): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=21743, stack(0x00007fc703069000,0x00007fc70316a000)]
Current CompileTask:
C2: 4418 3498 b 4 java.util.Properties$LineReader::<init> (38 bytes)
Stack: [0x00007fc703069000,0x00007fc70316a000], sp=0x00007fc703165520, free space=1009k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x574704] CodeBuffer::verify_section_allocation()+0x204
V [libjvm.so+0x574a0f] CodeBuffer::~CodeBuffer()+0xf
V [libjvm.so+0xbff167] PhaseOutput::scratch_emit_size(Node const*)+0x297
V [libjvm.so+0xbfaf50] PhaseOutput::shorten_branches(unsigned int*)+0x280
V [libjvm.so+0xc032aa] PhaseOutput::Output()+0x58a
V [libjvm.so+0x59eea4] Compile::Code_Gen()+0x5f4
V [libjvm.so+0x5a484b] Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x148b
V [libjvm.so+0x4e8579] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0xe9
V [libjvm.so+0x5ad061] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xd81
V [libjvm.so+0x5adbf8] CompileBroker::compiler_thread_loop()+0x4b8
V [libjvm.so+0xd917e0] JavaThread::thread_main_inner()+0xd0
V [libjvm.so+0xd94e6e] Thread::call_run()+0xde
V [libjvm.so+0xbeae11] thread_native_entry(Thread*)+0xe1
REGRESSION : Last worked in version 11.0.14-oracle
FREQUENCY : always