-
Bug
-
Resolution: Other
-
P3
-
None
-
16
-
None
-
Please run TestVectorPrintInline.java, then we get an error like this :
--------------- S U M M A R Y ------------
Command Line: --add-modules=jdk.incubator.vector -XX:UseSVE=0 -Xcomp -XX:CompileCommand=compileonly,TestCastL2XNode_S4::* -XX:+PrintOptoInlining TestCastL2XNode_S4
Host: jvmtest-44, AArch64, 128 cores, 251G, EulerOS release 2.0 (SP8)
Time: Wed Jan 20 21:17:06 2021 HKT elapsed time: 2.067808 seconds (0d 0h 0m 2s)--------------- T H R E A D ---------------
Current thread (0x0000ffffa83ef840): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=95640, stack(0x0000ffff32e00000,0x0000ffff33000000)]
Current CompileTask:
C2: 2067 23 b 4 TestCastL2XNode_S4::main (100 bytes)Stack: [0x0000ffff32e00000,0x0000ffff33000000], sp=0x0000ffff32ffacb0, free space=2027k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x831c4c] Compile::print_inlining_move_to(CallGenerator*)+0xb0
V [libjvm.so+0x712a24] LateInlineVirtualCallGenerator::do_late_inline()+0x634
V [libjvm.so+0x8298f0] Compile::inline_incrementally_one()+0x19c
V [libjvm.so+0x829db0] Compile::inline_incrementally(PhaseIterGVN&)+0x194
V [libjvm.so+0x82a400] Compile::Optimize()+0x174
V [libjvm.so+0x824a14] Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0xebc
V [libjvm.so+0x70e99c] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x10c
V [libjvm.so+0x840908] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x788
V [libjvm.so+0x83f6c4] CompileBroker::compiler_thread_loop()+0x378
V [libjvm.so+0x12e6b90] compiler_thread_entry(JavaThread*, Thread*)+0x84
V [libjvm.so+0x12e2a00] JavaThread::thread_main_inner()+0x178
V [libjvm.so+0x12e2874] JavaThread::run()+0x19c
V [libjvm.so+0x12dea14] Thread::call_run()+0x19c
V [libjvm.so+0x10368cc] thread_native_entry(Thread*)+0x1e4
C [libpthread.so.0+0x78bc] start_thread+0x19cPlease run TestVectorPrintInline.java, then we get an error like this : --------------- S U M M A R Y ------------ Command Line: --add-modules=jdk.incubator.vector -XX:UseSVE=0 -Xcomp -XX:CompileCommand=compileonly,TestCastL2XNode_S4::* -XX:+PrintOptoInlining TestCastL2XNode_S4 Host: jvmtest-44, AArch64, 128 cores, 251G, EulerOS release 2.0 (SP8) Time: Wed Jan 20 21:17:06 2021 HKT elapsed time: 2.067808 seconds (0d 0h 0m 2s) --------------- T H R E A D --------------- Current thread (0x0000ffffa83ef840): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=95640, stack(0x0000ffff32e00000,0x0000ffff33000000)] Current CompileTask: C2: 2067 23 b 4 TestCastL2XNode_S4::main (100 bytes) Stack: [0x0000ffff32e00000,0x0000ffff33000000] , sp=0x0000ffff32ffacb0, free space=2027k Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x831c4c] Compile::print_inlining_move_to(CallGenerator*)+0xb0 V [libjvm.so+0x712a24] LateInlineVirtualCallGenerator::do_late_inline()+0x634 V [libjvm.so+0x8298f0] Compile::inline_incrementally_one()+0x19c V [libjvm.so+0x829db0] Compile::inline_incrementally(PhaseIterGVN&)+0x194 V [libjvm.so+0x82a400] Compile::Optimize()+0x174 V [libjvm.so+0x824a14] Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0xebc V [libjvm.so+0x70e99c] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x10c V [libjvm.so+0x840908] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x788 V [libjvm.so+0x83f6c4] CompileBroker::compiler_thread_loop()+0x378 V [libjvm.so+0x12e6b90] compiler_thread_entry(JavaThread*, Thread*)+0x84 V [libjvm.so+0x12e2a00] JavaThread::thread_main_inner()+0x178 V [libjvm.so+0x12e2874] JavaThread::run()+0x19c V [libjvm.so+0x12dea14] Thread::call_run()+0x19c V [libjvm.so+0x10368cc] thread_native_entry(Thread*)+0x1e4 C [libpthread.so.0+0x78bc] start_thread+0x19c
-
generic
-
generic
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/home/wanghuang/repo/panama-vector/src/hotspot/share/opto/compile.cpp:4220), pid=115478, tid=115678
# Error: ShouldNotReachHere()
#
# Problematic frame:
# V [libjvm.so+0x821324] Compile::print_inlining_move_to(CallGenerator*)+0xb0
#
# Core dump will be written. Default location: /home/wanghuang/bug/core.%e.115478.%t
#
# 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: --add-modules=jdk.incubator.vector -Xcomp -XX:CompileCommand=compileonly,TestVectorPrintInline::* -XX:+PrintOptoInlining TestVectorPrintInline
--------------- T H R E A D ---------------
Current thread (0x0000ffff884f1f10): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=115678, stack(0x0000ffff1ae00000,0x0000ffff1b000000)]
Current CompileTask:
C2: 2437 35 b 4 TestVectorPrintInline::main (20 bytes)
Stack: [0x0000ffff1ae00000,0x0000ffff1b000000], sp=0x0000ffff1affab30, free space=2026k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x821324] Compile::print_inlining_move_to(CallGenerator*)+0xb0
V [libjvm.so+0x702134] LateInlineVirtualCallGenerator::do_late_inline()+0x634
V [libjvm.so+0x818fc8] Compile::inline_incrementally_one()+0x19c
V [libjvm.so+0x819488] Compile::inline_incrementally(PhaseIterGVN&)+0x194
V [libjvm.so+0x819ad8] Compile::Optimize()+0x174
V [libjvm.so+0x8140ec] Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0xebc
V [libjvm.so+0x6fe0ac] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x10c
V [libjvm.so+0x82ffe0] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x788
V [libjvm.so+0x82ed9c] CompileBroker::compiler_thread_loop()+0x378
V [libjvm.so+0x12d4934] compiler_thread_entry(JavaThread*, Thread*)+0x84
V [libjvm.so+0x12d07a4] JavaThread::thread_main_inner()+0x178
V [libjvm.so+0x12d0618] JavaThread::run()+0x19c
V [libjvm.so+0x12cc7b8] Thread::call_run()+0x19c
V [libjvm.so+0x1024670] thread_native_entry(Thread*)+0x1e4
C [libpthread.so.0+0x78bc] start_thread+0x19c
The reason is we use
```
virtual JVMState* generate(JVMState* jvms) {
Compile* C = Compile::current();
// Emit the CallDynamicJava and request separate projections so
// that the late inlining logic can distinguish between fall
// through and exceptional uses of the memory and io projections
// as is done for allocations and macro expansion.
JVMState* new_jvms = VirtualCallGenerator::generate(jvms);
if (call_node() != NULL) {
call_node()->set_generator(this);
}
return new_jvms;
}
```
we use `VirtualCallGenerator::generate` which calls `print_inlining_update ` to update print_inlining list. However, `virtual _late_inline` case is missing. When we call `Compile::print_inlining_move_to` in `LateInlineVirtualCallGenerator::do_late_inline()`, we can not find a LateInlineVirtualCallGenerator in `_print_inlining_list`.
We can fix this bug with adding this line in the constructor of `LateInlineVirtualCallGenerator`:
+ virtual bool is_late_inline() const { return true; }
- relates to
-
JDK-8260278 JVM crash when executing LateInlineVirtualCallGenerator::do_late_inline
-
- Closed
-