ADDITIONAL SYSTEM INFORMATION :
Linux 5.14.9-100.fc33.x86_64 x86_64 CentOS 8
A DESCRIPTION OF THE PROBLEM :
We have a moderately complicated Java test integration application that loads a number of isolated environments in custom ClassLoaders. In order to improve startup time, we want to adopt CDS, but initial attempts to follow the CDS guide and run -XX:ArchiveClassesAtExit lead to a JVM crash. Reproduced in 16.0.1, 17 GA, and a slowdebug build of 17u at 393547b2. The release builds crash with a SEGV, so I tried the slowdebug build to see if it gave more information, and it trips an assertion instead.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/home/service/jdk17u/src/hotspot/share/cds/archiveBuilder.hpp:296), pid=142855, tid=142874
# assert(is_in_buffer_space(obj)) failed: must be
#
# JRE version: OpenJDK Runtime Environment (17.0) (slowdebug build 17-internal+0-adhoc.service.jdk17u)
# Java VM: OpenJDK 64-Bit Server VM (slowdebug 17-internal+0-adhoc.service.jdk17u, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x510f62] unsigned char* ArchiveBuilder::to_requested<unsigned char*>(unsigned char*) const+0x34
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /usr/local/lib/service/core.142855)
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
(see attached hs err log for details)