JDK-8271234 : [lworld] InlineTypeBaseNode::merge_with fails with assert(i < _cnt)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-07-23
  • Updated: 2021-08-05
  • Resolved: 2021-08-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.
Other
repo-valhallaFixed
Related Reports
Relates :  
Relates :  
Description
VM asserts when running with a few JDK value-based classes as ref-default primitive class (attached refval.patch of the JDK change) when building `exploded-image-optimize` target.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/Users/mlchung/ws/valhalla/lworld-dev/src/hotspot/share/opto/node.hpp:439), pid=96197, tid=39683
#  assert(i < _cnt) failed: oob: i=3, _cnt=3
#
# JRE version: OpenJDK Runtime Environment (18.0) (fastdebug build 18-internal+0-adhoc.mlchung.lworld-dev)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 18-internal+0-adhoc.mlchung.lworld-dev, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

Current CompileTask:
C2:   1201  506       4       jdk.internal.module.ModulePath$$Lambda$9/0x000000080000cc20::apply (12 bytes)

Stack: [0x00007000019a8000,0x0000700001aa8000],  sp=0x0000700001aa39e0,  free space=1006k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x12faecc]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x6dc
V  [libjvm.dylib+0x12fb4eb]  VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x3b
V  [libjvm.dylib+0x6471ad]  report_vm_error(char const*, int, char const*, char const*, ...)+0xdd
V  [libjvm.dylib+0x12d827]  Node::set_req(unsigned int, Node*)+0x87
V  [libjvm.dylib+0x8f40bc]  InlineTypeBaseNode::merge_with(PhaseGVN*, InlineTypeBaseNode const*, int, bool)+0x2ec
V  [libjvm.dylib+0x4fe920]  PhiNode::Ideal(PhaseGVN*, bool)+0x6b0
V  [libjvm.dylib+0xf48711]  PhaseIterGVN::transform_old(Node*)+0x131
V  [libjvm.dylib+0xf47fd4]  PhaseIterGVN::optimize()+0xb4
V  [libjvm.dylib+0x5e740c]  Compile::Optimize()+0x25c
V  [libjvm.dylib+0x5e5afe]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x18ae
V  [libjvm.dylib+0x4c5009]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x109
V  [libjvm.dylib+0x60688f]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x93f
V  [libjvm.dylib+0x605d30]  CompileBroker::compiler_thread_loop()+0x2c0
V  [libjvm.dylib+0x1249d2c]  JavaThread::thread_main_inner()+0x28c
V  [libjvm.dylib+0x1249a4d]  JavaThread::run()+0x2ad
V  [libjvm.dylib+0x1246bc7]  Thread::call_run()+0x177
V  [libjvm.dylib+0xee48b0]  thread_native_entry(Thread*)+0x150
C  [libsystem_pthread.dylib+0x6109]  _pthread_start+0x94
C  [libsystem_pthread.dylib+0x1b8b]  thread_start+0xf



Comments
Looks like another (not JIT related) bug.
03-08-2021

[~mchung] the build still fails even after fixing this: # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (/oracle/valhalla2/open/src/hotspot/share/cds/heapShared.cpp:146), pid=125547, tid=125554 # assert(!EnableValhalla || !p->mark().is_inline_type()) failed: this object should never have been locked # # JRE version: Java(TM) SE Runtime Environment (18.0) (fastdebug build 18-internal+0-2021-05-07-0658132.tobias...) # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18-internal+0-2021-05-07-0658132.tobias..., interpreted mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0xe26e75] HeapShared::oop_hash(oop const&)+0x95 # # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /oracle/valhalla2/core.125547) # # 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: -Xint -Xshare:dump -XX:SharedClassListFile=/oracle/valhalla2/build/fast/support/link_opt/classlist.interim -XX:SharedArchiveFile=/oracle/valhalla2/build/fast/support/link_opt/classlist.jsa -Xmx128M -Xms128M Host: prometheus, Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz, 12 cores, 31G, Ubuntu 20.04.2 LTS Time: Tue Aug 3 15:50:36 2021 CEST elapsed time: 1.049114 seconds (0d 0h 0m 1s) --------------- T H R E A D --------------- Current thread (0x00007fd8f4232de0): VMThread "VM Thread" [stack: 0x00007fd8f8300000,0x00007fd8f8400000] [id=125554] Stack: [0x00007fd8f8300000,0x00007fd8f8400000], sp=0x00007fd8f83fda00, free space=1014k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0xe26e75] HeapShared::oop_hash(oop const&)+0x95 V [libjvm.so+0xe26ec2] HeapShared::find_archived_heap_object(oop)+0x32 V [libjvm.so+0xe31492] HeapShared::archive_reachable_objects_from(int, KlassSubGraphInfo*, oop, bool)+0x132 V [libjvm.so+0xe3bb2c] void WalkOopAndArchiveClosure::do_oop_work<narrowOop>(narrowOop*)+0x30c V [libjvm.so+0xe3c1b7] void OopOopIterateDispatch<WalkOopAndArchiveClosure>::Table::oop_oop_iterate<InstanceKlass, narrowOop>(WalkOopAndArchiveClosure*, oop, Klass*)+0xa7 V [libjvm.so+0xe319f2] HeapShared::archive_reachable_objects_from(int, KlassSubGraphInfo*, oop, bool)+0x692 V [libjvm.so+0xe3bb2c] void WalkOopAndArchiveClosure::do_oop_work<narrowOop>(narrowOop*)+0x30c V [libjvm.so+0xe3c1b7] void OopOopIterateDispatch<WalkOopAndArchiveClosure>::Table::oop_oop_iterate<InstanceKlass, narrowOop>(WalkOopAndArchiveClosure*, oop, Klass*)+0xa7 V [libjvm.so+0xe319f2] HeapShared::archive_reachable_objects_from(int, KlassSubGraphInfo*, oop, bool)+0x692 V [libjvm.so+0xe3261f] HeapShared::archive_reachable_objects_from_static_field(InstanceKlass*, char const*, int, char const*, bool)+0x21f V [libjvm.so+0xe33027] HeapShared::copy_open_objects(GrowableArray<MemRegion>*)+0x117 V [libjvm.so+0xe33285] HeapShared::archive_objects(GrowableArray<MemRegion>*, GrowableArray<MemRegion>*)+0xe5 V [libjvm.so+0x14f0a62] VM_PopulateDumpSharedSpace::dump_java_heap_objects(GrowableArray<Klass*>*) [clone .part.0]+0x302 V [libjvm.so+0x14f8b47] VM_PopulateDumpSharedSpace::doit()+0x337 V [libjvm.so+0x1a6949a] VM_Operation::evaluate()+0x18a V [libjvm.so+0x1a8ca13] VMThread::evaluate_operation(VM_Operation*)+0x183 V [libjvm.so+0x1a8d69c] VMThread::inner_execute(VM_Operation*)+0x20c V [libjvm.so+0x1a8d8e5] VMThread::loop()+0xb5 V [libjvm.so+0x1a8da17] VMThread::run()+0xc7 V [libjvm.so+0x196d680] Thread::call_run()+0x100 V [libjvm.so+0x161dfc4] thread_native_entry(Thread*)+0x104
03-08-2021