JDK-8210289 : ArchivedKlassSubGraphInfoRecord is incomplete
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-09-02
  • Updated: 2020-03-12
  • Resolved: 2018-09-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.
JDK 11 JDK 12
11.0.7Fixed 12 b11Fixed
Related Reports
Duplicate :  
Relates :  
Description
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.


Comments
Backport request (jdk11u): Patch applies cleanly. Tested SharedArchiveFile(base cds tests), appcds tests and tier1 on linux-x64 with patch applied.
31-01-2020

Work has started. See review thread http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2018-September/029889.html
02-09-2018