When heapShared.cpp dumps a sub-graph of heap objects, it attempts to record all the classes of all the objects that are referenced by this sub-graph.
However, if one of these objects have already been visited while a previous sub-graph was dumped, then this object's class is not recorded in the current sub-graph.
The bug is in the return statement of the following block
http://hg.openjdk.java.net/jdk/jdk/file/9720ad0a40b6/src/hotspot/share/memory/heapShared.cpp#l394
oop archived = MetaspaceShared::find_archived_heap_object(obj);
if (archived != NULL) {
...
return;
}
At runtime, if the current sub-graph is restored before any other sub-graphs, we will end up with a live object in the Java heap with an uninitialized class.