ADDITIONAL SYSTEM INFORMATION :
Fedora Linux 33, Java 15.0.2+7
A DESCRIPTION OF THE PROBLEM :
When running IntelliJ to develop in the JDK, I get quite frequent crashes in C1 when it compiles com/intellij/codeInspection/sameParameterValue/SameParameterValueInspection$LocalSameParameterValueInspection$1
This happend with Fedora Java, AdoptOpenJDK as well as official Oracle OpenJDK builds.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (javaCalls.cpp:60), pid=6248, tid=6261
# guarantee(thread->can_call_java()) failed: cannot make java calls from the native compiler
#
# JRE version: OpenJDK Runtime Environment (15.0.2+7) (build 15.0.2+7-27)
# Java VM: OpenJDK 64-Bit Server VM (15.0.2+7-27, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x773869] JavaCallWrapper::JavaCallWrapper(methodHandle const&, Handle, JavaValue*, Thread*)+0x1e9
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/ce/core.6248)
#
# 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: -Xms128m -Xmx4096m -XX:SoftRefLRUPolicyMSPerMB=50 -ea -DXX:CompileCommand=exclude,com/intellij/codeInspection/sameParameterValue/SameParameterValueInspection$LocalSameParameterValueInspection$1 -Dsun.io.useCanonPrefixCache=false -Djava.net.preferIPv4Stack=true -Djdk.http.auth.tunneling.disabledSchemes="" -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Djdk.attach.allowAttachSelf -Dkotlinx.coroutines.debug=off -Djdk.module.illegalAccess.silent=true -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine -Dsun.tools.attach.tmp.only=true -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=1 -XX:ErrorFile=/home/ce/java_error_in_idea_%p.log -XX:HeapDumpPath=/home/ce/java_error_in_idea_.hprof -Didea.vendor.name=JetBrains -Didea.paths.selector=IntelliJIdea2020.3 -Djb.vmOptionsFile=/home/ce/.config/JetBrains/IntelliJIdea2020.3/idea64.vmoptions -Didea.jre.check=true com.intellij.idea.Main
Host: AMD Ryzen 5 4500U with Radeon Graphics, 6 cores, 14G, Fedora release 33 (Thirty Three)
Time: Fri Feb 5 09:24:15 2021 CET elapsed time: 4647.815840 seconds (0d 1h 17m 27s)
--------------- T H R E A D ---------------
Current thread (0x00007f53e4116740): JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=6261, stack(0x00007f53ab3fc000,0x00007f53ab4fd000)]
Current CompileTask:
C1:4647815 71249 3 com.intellij.codeInspection.sameParameterValue.SameParameterValueInspection$LocalSameParameterValueInspection$1::visitMethod (362 bytes)
Stack: [0x00007f53ab3fc000,0x00007f53ab4fd000], sp=0x00007f53ab4fa1c0, free space=1016k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x773869] JavaCallWrapper::JavaCallWrapper(methodHandle const&, Handle, JavaValue*, Thread*)+0x1e9
V [libjvm.so+0x774020] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x100
V [libjvm.so+0x77589b] JavaCalls::call_special(JavaValue*, Handle, Klass*, Symbol*, Symbol*, Handle, Handle, Thread*)+0x19b
V [libjvm.so+0xca429f] SystemDictionary::validate_protection_domain(InstanceKlass*, Handle, Handle, Thread*)+0x20f
V [libjvm.so+0xca6c08] SystemDictionary::resolve_instance_class_or_null(Symbol*, Handle, Handle, Thread*)+0x598
V [libjvm.so+0xca928e] SystemDictionary::resolve_or_fail(Symbol*, Handle, Handle, bool, Thread*)+0x5e
V [libjvm.so+0x558658] ConstantPool::klass_at_impl(constantPoolHandle const&, int, bool, Thread*)+0xe8
V [libjvm.so+0x753428] InstanceKlass::has_nest_member(InstanceKlass*, Thread*) const+0x308
V [libjvm.so+0x753fae] InstanceKlass::nest_host(Thread*) [clone .part.0]+0x50e
V [libjvm.so+0x7541b0] InstanceKlass::has_nestmate_access_to(InstanceKlass*, Thread*)+0x50
V [libjvm.so+0xbd080b] Reflection::verify_member_access(Klass const*, Klass const*, Klass const*, AccessFlags, bool, bool, Thread*)+0x1cb
V [libjvm.so+0x9c95a1] LinkResolver::check_method_accessability(Klass*, Klass*, Klass*, methodHandle const&, Thread*)+0x61
V [libjvm.so+0x9ca12e] LinkResolver::resolve_method(LinkInfo const&, Bytecodes::Code, Thread*)+0x31e
V [libjvm.so+0x9cccda] LinkResolver::linktime_resolve_virtual_method(LinkInfo const&, Thread*)+0x2a
V [libjvm.so+0x9ccf53] LinkResolver::linktime_resolve_virtual_method_or_null(LinkInfo const&)+0x33
V [libjvm.so+0x4a7e89] ciEnv::lookup_method(ciInstanceKlass*, ciKlass*, Symbol*, Symbol*, Bytecodes::Code, constantTag)+0xb9
V [libjvm.so+0x4a8088] ciEnv::get_method_by_index_impl(constantPoolHandle const&, int, Bytecodes::Code, ciInstanceKlass*)+0x118
V [libjvm.so+0x4c6d1d] ciBytecodeStream::get_method(bool&, ciSignature**)+0x10d
V [libjvm.so+0x3eb116] GraphBuilder::invoke(Bytecodes::Code)+0x36
V [libjvm.so+0x3ecccb] GraphBuilder::iterate_bytecodes_for_block(int)+0x5cb
V [libjvm.so+0x3ef20d] GraphBuilder::iterate_all_blocks(bool)+0x6d
V [libjvm.so+0x3f12e6] GraphBuilder::GraphBuilder(Compilation*, IRScope*)+0x316
V [libjvm.so+0x3f6cea] IRScope::IRScope(Compilation*, IRScope*, int, ciMethod*, int, bool)+0x1ca
V [libjvm.so+0x3f6da3] IR::IR(Compilation*, ciMethod*, int)+0xa3
V [libjvm.so+0x3d1273] Compilation::build_hir() [clone .part.0]+0x163
V [libjvm.so+0x3d21cc] Compilation::compile_java_method()+0x3bc
V [libjvm.so+0x3d2338] Compilation::compile_method()+0x108
V [libjvm.so+0x3d27ac] Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*, DirectiveSet*)+0x20c
V [libjvm.so+0x3d32fd] Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0xad
V [libjvm.so+0x536388] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xd18
V [libjvm.so+0x536dd8] CompileBroker::compiler_thread_loop()+0x4e8
V [libjvm.so+0xcf2d6e] JavaThread::thread_main_inner()+0xde
V [libjvm.so+0xcf7bdd] Thread::call_run()+0xfd
V [libjvm.so+0xb4ac87] thread_native_entry(Thread*)+0xe7
END.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run IntelliJ with a large Project
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
C1 should compile without aborting, or bail out
ACTUAL -
C1 crashes with an internal error:
# Internal Error (javaCalls.cpp:60), pid=6248, tid=6261
# guarantee(thread->can_call_java()) failed: cannot make java calls from the native compiler
CUSTOMER SUBMITTED WORKAROUND :
run with -XX:CompileCommand=exclude,com/intellij/codeInspection/sameParameterValue/SameParameterValueInspection$LocalSameParameterValueInspection$1
FREQUENCY : always