JDK-8330247 : C2: CTW fail with assert(adr_t->is_known_instance_field()) failed: instance required
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 23
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-04-15
  • Updated: 2024-05-09
  • Resolved: 2024-05-03
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 23
23 b22Fixed
Related Reports
Relates :  
Relates :  
Description
Looks to be a recent regression, bisected to JDK-8316991.

$ export JAVA_HOME=<point to fastdebug build>
$ export PATH=$JAVA_HOME/bin:$PATH
$ cd test/hotspot/jtreg/testlibrary/ctw
$ make
$ cd dist
$ wget https://repo1.maven.org/maven2/org/jgrapht/jgrapht-jdk1.5/0.7.3/jgrapht-jdk1.5-0.7.3.jar
$ ./ctw.sh jgrapht-jdk1.5-0.7.3.jar

#  Internal Error (/home/shipilev/shipilev-jdk/src/hotspot/share/opto/macro.cpp:453), pid=42339, tid=42353
#  assert(adr_t->is_known_instance_field()) failed: instance required

Current CompileTask:
C2:2342 3329   !b  4       org.jgrapht.graph.DefaultListenableGraph::clone (53 bytes)

Stack: [0x0000ffff36d8e000,0x0000ffff36f8c000],  sp=0x0000ffff36f863c0,  free space=2016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x11da238]  PhaseMacroExpand::value_from_mem(Node*, Node*, BasicType, Type const*, TypeOopPtr const*, AllocateNode*)+0x968  (macro.cpp:453)
V  [libjvm.so+0x11db1c8]  PhaseMacroExpand::create_scalarized_object_description(AllocateNode*, SafePointNode*)+0x368  (macro.cpp:812)
V  [libjvm.so+0xb13254]  ConnectionGraph::reduce_phi_on_safepoints_helper(Node*, Node*, Node*, Unique_Node_List&)+0x2d4  (escape.cpp:1215)
V  [libjvm.so+0xb13654]  ConnectionGraph::reduce_phi_on_safepoints(PhiNode*)+0xd4  (escape.cpp:1144)
V  [libjvm.so+0xb2a648]  ConnectionGraph::compute_escape()+0x1a88  (escape.cpp:425)
V  [libjvm.so+0xb2abe8]  ConnectionGraph::do_analysis(Compile*, PhaseIterGVN*)+0xc8  (escape.cpp:119)
V  [libjvm.so+0x96f1ac]  Compile::Optimize()+0x520  (compile.cpp:2342)
V  [libjvm.so+0x970ed8]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x10f8  (compile.cpp:861)
V  [libjvm.so+0x7bf7b0]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x170  (c2compiler.cpp:142)
V  [libjvm.so+0x97b408]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x528  (compileBroker.cpp:2304)
V  [libjvm.so+0x97c1ec]  CompileBroker::compiler_thread_loop()+0x39c  (compileBroker.cpp:1963)
V  [libjvm.so+0xde68f4]  JavaThread::thread_main_inner()+0x1d4  (javaThread.cpp:759)
V  [libjvm.so+0x17463c0]  Thread::call_run()+0x120  (thread.cpp:221)
V  [libjvm.so+0x139044c]  thread_native_entry(Thread*)+0x12c  (os_linux.cpp:846)
C  [libpthread.so.0+0x7230]  start_thread+0xb0

For the record, this was also reproduced by [~roland]:

I'm also seeing failures with:
# Internal Error (/home/roland/jdk-jdk/src/hotspot/share/opto/macro.cpp:453), pid=2063630, tid=2063644
# assert(adr_t->is_known_instance_field()) failed: instance required

For example with:
https://repo1.maven.org/maven2/org/evosuite/evosuite-master/1.0.6/evosuite-master-1.0.6.jar
Comments
Changeset: 9347bb7d Author: Cesar Soares Lucas <cslucas@openjdk.org> Committer: Vladimir Kozlov <kvn@openjdk.org> Date: 2024-05-03 23:41:12 +0000 URL: https://git.openjdk.org/jdk/commit/9347bb7df845ee465c378c6f511ef8a6caea18ea
03-05-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/18851 Date: 2024-04-19 00:35:16 +0000
19-04-2024

Thanks for assigning. I'm on it!
15-04-2024

ILW = Assertion failure during EA, single test case (so far), use -XX:-ReduceAllocationMerges = HLM = P3
15-04-2024

Cesar, I think this is one of yours :)
15-04-2024