JDK-8330795 : C2: assert((uint)type <= T_CONFLICT && _zero_type[type] != nullptr) failed: bad type with -XX:-UseCompressedClassPointers
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 23
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-04-22
  • Updated: 2024-05-20
  • Resolved: 2024-05-15
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 b23Fixed
Related Reports
Relates :  
Description
Running test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java with -XX:-UseCompressedClassPointers results in the following assertion failure.

This starts to happen after JDK-8316991.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/0db9c48f-6638-40d0-9a4b-bd9cc7533eb8-S10207/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/74979b04-ad1b-480a-bf47-74c960c8b7c8/runs/51f3ccd6-5237-43fb-bdcb-78484c030f84/workspace/open/src/hotspot/share/opto/type.hpp:412), pid=2189604, tid=2189678
#  assert((uint)type <= T_CONFLICT && _zero_type[type] != nullptr) failed: bad type
#
# JRE version: Java(TM) SE Runtime Environment (23.0+20) (fastdebug build 23-ea+20-1590)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 23-ea+20-1590, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1521ccc]  PhaseValues::zerocon(BasicType)+0xbc
..........
Command Line: -DReproduce=true -Djava.library.path=. -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dir.framework.server.port=43999 -XX:+UnlockDiagnosticVMOptions -XX:+ReduceAllocationMerges -XX:-BackgroundCompilation -XX:-UseCompressedClassPointers compiler.lib.ir_framework.test.TestVM compiler.c2.irTests.scalarReplacement.AllocationMergesTests
..........
Current CompileTask:
C2:1561 1266    b  4       compiler.c2.irTests.scalarReplacement.AllocationMergesTests::testLoadNarrowKlass_C2 (6 bytes)

Stack: [0x00007530051fe000,0x00007530052fe000],  sp=0x00007530052f8670,  free space=1001k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1521ccc]  PhaseValues::zerocon(BasicType)+0xbc  (type.hpp:412)
V  [libjvm.so+0xba80ad]  ConnectionGraph::split_castpp_load_through_phi(Node*, Node*, Node*, GrowableArray<Node*>*, GrowableArray<Node*>&)+0x6d
V  [libjvm.so+0xbaa825]  ConnectionGraph::reduce_phi_on_castpp_field_load(Node*, GrowableArray<Node*>&, GrowableArray<Node*>&)+0x405
V  [libjvm.so+0xbaaf55]  ConnectionGraph::reduce_phi(PhiNode*, GrowableArray<Node*>&, GrowableArray<Node*>&)+0x465
V  [libjvm.so+0xbae053]  ConnectionGraph::split_unique_types(GrowableArray<Node*>&, GrowableArray<ArrayCopyNode*>&, GrowableArray<MergeMemNode*>&, Unique_Node_List&)+0x603
V  [libjvm.so+0xbb9421]  ConnectionGraph::compute_escape()+0x2081
V  [libjvm.so+0xbb9c11]  ConnectionGraph::do_analysis(Compile*, PhaseIterGVN*)+0xf1
V  [libjvm.so+0x9e452a]  Compile::Optimize()+0x63a
V  [libjvm.so+0x9e8380]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1b50
V  [libjvm.so+0x83d295]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1d5
V  [libjvm.so+0x9f4218]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x928
V  [libjvm.so+0x9f4ea8]  CompileBroker::compiler_thread_loop()+0x478
V  [libjvm.so+0xe9bd6c]  JavaThread::thread_main_inner()+0xcc
V  [libjvm.so+0x17ae846]  Thread::call_run()+0xb6
V  [libjvm.so+0x1498bb7]  thread_native_entry(Thread*)+0x127
Comments
Changeset: 4e77cf88 Author: Cesar Soares Lucas <cslucas@openjdk.org> Committer: Vladimir Kozlov <kvn@openjdk.org> Date: 2024-05-15 01:46:22 +0000 URL: https://git.openjdk.org/jdk/commit/4e77cf881d031e5b0320915b3eabd7702e560291
15-05-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/19148 Date: 2024-05-08 23:44:26 +0000
08-05-2024

Sounds good, thanks!
23-04-2024

Thanks for assigning to me Christian, and sorry for the noise! I already have a fix for most of the other issues. I didn't debug yet, but judging by the error message I think this one is probably related to one of the others. Anyway, I'll have a PR out to deal with all these bugs in the next few days.
22-04-2024

There have been a couple of reports already related to JDK-8316991. [~cslucas] would a backout make sense or can it all be traced to the same issue? What do you think?
22-04-2024

ILW = Assertion failure during EA, single test case, use -XX:-ReduceAllocationMerges = HLM = P3
22-04-2024

Might be related to an already existing report linked to JDK-8316991. [~cslucas] can you have a look? Thanks!
22-04-2024