JDK-8315719 : [premain] -XX:+ArchiveInvokeDynamic is incompatible with old classes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: repo-leyden
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-09-05
  • Updated: 2024-07-11
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-leydenUnresolved
Related Reports
Relates :  
Description
In JDK mainline, linked old classes are excluded from the CDS archive (see JDK-8309074 for the reason)
In leyden-premain, -XX:+ArchiveInvokeDynamic can create archived heap objects (MethodType) that reference linked old classes.

As a result, we get an error like this when running 'java -Xshare:dump -XX:ArchiveInvokeDynamic"

#  Internal Error (/jdk3/le3/open/src/hotspot/share/cds/archiveBuilder.hpp:300), pid=3992961, tid=3993274
#  assert(is_in_buffer_space(obj)) failed: must be

Stack: [0x00007fffd89d3000,0x00007fffd8ad3000],  sp=0x00007fffd8ad1110,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x5e7ec8]  unsigned char* ArchiveBuilder::to_requested<unsigned char*>(unsigned char*) const+0x50  (archiveBuilder.hpp:300)
V  [libjvm.so+0x5f8447]  ArchiveHeapWriter::compute_ptrmap(ArchiveHeapInfo*)+0x279  (archiveHeapWriter.cpp:692)
V  [libjvm.so+0x5f7ed2]  ArchiveHeapWriter::relocate_embedded_oops(GrowableArrayCHeap<oopDesc*, (MEMFLAGS)13>*, ArchiveHeapInfo*, GrowableArray<unsigned long>*, int)+0x25e  (archiveHeapWriter.cpp:592)
V  [libjvm.so+0x5f6476]  ArchiveHeapWriter::write(GrowableArrayCHeap<oopDesc*, (MEMFLAGS)13>*, ArchiveHeapInfo*)+0xda  (archiveHeapWriter.cpp:112)
V  [libjvm.so+0xd03eaa]  HeapShared::archive_objects(ArchiveHeapInfo*)+0x168  (heapShared.cpp:680)

Comments
This will be addressed in JDK-8317269 - Preload all verification dependencies for archived classes.
28-09-2023