JDK-8268676 : assert(!ik->is_interface() && !ik->has_subklass()) failed: inconsistent klass hierarchy
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2021-06-14
  • Updated: 2021-12-09
  • Resolved: 2021-06-17
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
17 b28Fixed 18Fixed
Related Reports
Relates :  
Relates :  
Description
Test: applications/ctw/modules/jdk_jdi.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/35546316-ed70-4084-8244-d672e7734fd1-S13258/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/b3c7cce6-0a16-4df3-b2c3-8ad758c8e7da/runs/31f02daf-e073-40dd-94a3-3980598c9dd4/workspace/open/src/hotspot/share/opto/arraycopynode.cpp:199), pid=1692035, tid=1692052
#  assert(!ik->is_interface() && !ik->has_subklass()) failed: inconsistent klass hierarchy
#
# JRE version: Java(TM) SE Runtime Environment (18.0+2) (fastdebug build 18-ea+2-16)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18-ea+2-16, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
# Problematic frame:
# V  [libjvm.so+0x5eb8fc]  ArrayCopyNode::try_clone_instance(PhaseGVN*, bool, int)+0xcac
#
# Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /opt/mach5/mesos/work_dir/slaves/35546316-ed70-4084-8244-d672e7734fd1-S13237/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/825f5b1a-809d-4c6f-a0e2-5c6ba44ebbb4/runs/f3c58233-329a-462a-b148-e87cd3893830/testoutput/test-support/jtreg_open_test_hotspot_jtreg_ctw_1/scratch/2/core.1692035)
#
# 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: -XX:MaxRAMPercentage=6.25 -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/35546316-ed70-4084-8244-d672e7734fd1-S13237/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/825f5b1a-809d-4c6f-a0e2-5c6ba44ebbb4/runs/f3c58233-329a-462a-b148-e87cd3893830/testoutput/test-support/jtreg_open_test_hotspot_jtreg_ctw_1/tmp -XX:+CreateCoredumpOnCrash -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -XX:-TieredCompilation -Djava.awt.headless=true -Xbatch -XX:-UseCounterDecay -XX:-ShowMessageBoxOnError -XX:+UnlockDiagnosticVMOptions -XX:+DisplayVMOutputToStderr -DCompileTheWorldStartAt=0 -DCompileTheWorldStopAt=542 -XX:+WhiteBoxAPI -Xbootclasspath/a:. --add-exports=java.base/jdk.internal.jimage=ALL-UNNAMED --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED --add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED --add-exports=java.base/jdk.internal.access=ALL-UNNAMED -XX:+LogCompilation -XX:LogFile=hotspot_modules_jdk_jdi_0_%p.log -XX:ErrorFile=hs_err_modules_jdk_jdi_0_%p.log -XX:ReplayDataFile=replay_modules_jdk_jdi_0_%p.log -XX:CompileCommand=exclude,java/lang/invoke/MethodHandle.* -XX:+IgnoreUnrecognizedVMOptions -XX:+StressLCM -XX:+StressGCM -XX:+StressIGVN -XX:+StressCCP -XX:StressSeed=5894536079750725134 sun.hotspot.tools.ctw.CompileTheWorld modules:jdk.jdi

Host: AArch64, 8 cores, 46G, Oracle Linux Server release 8.3
Time: Mon Jun 14 12:47:25 2021 UTC elapsed time: 12.943449 seconds (0d 0h 0m 12s)

---------------  T H R E A D  ---------------

Current thread (0x0000fffbc43f7d40):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=1692052, stack(0x0000fffbb0000000,0x0000fffbb0200000)]


Current CompileTask:
C2:  12943 1820   !b        com.sun.tools.jdi.ConnectorImpl$ArgumentImpl::clone (14 bytes)

Stack: [0x0000fffbb0000000,0x0000fffbb0200000],  sp=0x0000fffbb01fba60,  free space=2030k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x5eb8fc]  ArrayCopyNode::try_clone_instance(PhaseGVN*, bool, int)+0xcac
V  [libjvm.so+0x5ec0ec]  ArrayCopyNode::Ideal(PhaseGVN*, bool)+0x4f8
V  [libjvm.so+0x14a8884]  PhaseGVN::transform_no_reclaim(Node*)+0x70
V  [libjvm.so+0x61a774]  BarrierSetC2::clone(GraphKit*, Node*, Node*, Node*, bool) const+0x314
V  [libjvm.so+0x7e79b0]  CardTableBarrierSetC2::clone(GraphKit*, Node*, Node*, Node*, bool) const+0x2c
V  [libjvm.so+0x118363c]  LibraryCallKit::copy_to_clone(Node*, Node*, Node*, bool)+0x18c
V  [libjvm.so+0x119a510]  LibraryCallKit::inline_native_clone(bool)+0x7bc
V  [libjvm.so+0x119e36c]  LibraryIntrinsic::generate(JVMState*)+0x338
V  [libjvm.so+0xae5468]  Parse::do_call()+0x344
V  [libjvm.so+0x147bc60]  Parse::do_one_bytecode()+0x34c
V  [libjvm.so+0x146a6d4]  Parse::do_one_block()+0x824
V  [libjvm.so+0x146b688]  Parse::do_all_blocks()+0x148
V  [libjvm.so+0x146f774]  Parse::Parse(JVMState*, ciMethod*, float)+0xa74
V  [libjvm.so+0x7b9ae0]  ParseGenerator::generate(JVMState*)+0x110
V  [libjvm.so+0x985658]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0xdc4
V  [libjvm.so+0x7b701c]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x178
V  [libjvm.so+0x99553c]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb0c
V  [libjvm.so+0x996144]  CompileBroker::compiler_thread_loop()+0x324
V  [libjvm.so+0x16ff7ec]  JavaThread::thread_main_inner()+0x28c
V  [libjvm.so+0x1709a28]  Thread::call_run()+0xf8
V  [libjvm.so+0x1426064]  thread_native_entry(Thread*)+0x104
C  [libpthread.so.0+0x7738]  start_thread+0x198

Comments
cleaning up :-)
09-12-2021

Changeset: 85452692 Author: Vladimir Ivanov <vlivanov@openjdk.org> Date: 2021-06-17 21:17:48 +0000 URL: https://git.openjdk.java.net/jdk17/commit/8545269268ff34a5c6b8a8cc6aff69fff2a7b507
17-06-2021

My working theory: the failure is caused by concurrent class loading. JDK-8267947 disabled the caching for "has_subklass() == false" and it became more likely to observe the change when concurrent class loading happens. It makes the bug assertion-only problem. The compilation will fail during dependency validation since the class is not a leaf type anymore.
15-06-2021

[~dlong] yes, I don't think 17 & 18 diverged that much, so most likely 17 is also affected.
15-06-2021

[~vaivanov] If this affects 18 then it is likely to affect 17 as well. Do you agree?
14-06-2021

ILW = assert, aarch64 debug build only, one test only, no workaround = HLH = P2
14-06-2021

[~vlivanov] Could you take a look at this one?
14-06-2021