RFR: 8209971: TestOptionsWithRanges.java crashes in CDS mode with G1UpdateBufferSize=1
Jiangli Zhou
jiangli.zhou at oracle.com
Thu Sep 6 02:58:20 UTC 2018
Please review the following fix for JDK-8209971,
TestOptionsWithRanges.java crashes in CDS mode with G1UpdateBufferSize=1.
webrev: http://cr.openjdk.java.net/~jiangli/8209971/webrev.00/
bug: https://bugs.openjdk.java.net/browse/JDK-8209971
This is a pre-existing issue that's exposed when archived heap object
relocation is enabled. At CDS runtime, the archived heap regions are
mapped back to the runtime java heap. As the mapped heap data may not
occupy the entire runtime GC region(s), the empty spaces within the
regions are filled with dummy objects, which is done by a fixup process
after mapping the data. The fixup was done after
SystemDictionary::initialize(), because fixup needs to access
SystemDictionary::Object_klass() (in some cases). However that is too
late as archived java objects are accessed when
SystemDictionary::initialize() resolves well-known classes.
The solution is to call MetaspaceShared::fixup_mapped_heap_regions() at
an earlier time. In the webre, the call is moved into
SystemDictionary::resolve_preloaded_classes(). It's called after
resolve_wk_klasses_through(WK_KLASS_ENUM_NAME(Object_klass)...), but
before any of the archived java objects is accessed. No mirror object is
access/restored during
resolve_wk_klasses_through(WK_KLASS_ENUM_NAME(Object_klass)...).
Archived mirrors are restored after java.lang.Class is loaded.
Tested TestOptionsWithRanges.java locally in CDS mode. Tier1 - tier5
normal runs and tier1 - tier4 default CDS runs are in progress.
Thanks,
Jiangli
More information about the hotspot-runtime-dev
mailing list