JDK-8200466 : Revisit the setting of _transitive_interfaces in InstanceKlass
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-03-29
  • Updated: 2019-06-20
  • Resolved: 2018-05-02
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
11 b12Fixed
Related Reports
Relates :  
Description
During the investigation of JDK-8200078, it was found that when a class fails to load due to OOM, GC will try to free the class and its _transitive_interfaces. The _transitive_interfaces could be shared with its super class which has been loaded successfully. When GC tries to free the class, InstanceKlass::deallocate_interfaces() mistakenly frees the _transitive_interfaces. It will cause a vm crash in visit_all_interfaces() in klassVTable.cpp when an bad intf is dereferenced.
Comments
An approach is to delay the setting of _transitive_interfaces in InstanceKlass in ClassFileParser::apply_parsed_class_metadata(). Also not clearing the _transitive_interfaces in clear_class_metadata(). In ClassFileParser::fill_instance_klass(), pass the _transitive_interfaces as an arg into ik->initialize_supers(). Afterward, set the _transitive_interfaces in InstanceKlass and then clear the _transitve_interfaces (same as being done in clear_class_metadata()).
29-03-2018