JDK-8203960 : [TESTBUG] runtime/logging/DefaultMethodsTest.java failed when running in CDS mode
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-05-30
  • Updated: 2018-06-11
  • Resolved: 2018-05-31
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 b17Fixed
Related Reports
Relates :  
Description
Steps to reproduce:
1. Create CDS archive (java -Xshare:dump)
2. run the test using jtreg

java.lang.RuntimeException: 'Slots that need filling:' missing from stdout/stderr 

	at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:150)
	at DefaultMethodsTest.main(DefaultMethodsTest.java:42)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.sun.javatest.regtest.agent.MainActionHelper$SameVMRunnable.run(MainActionHelper.java:229)
	at java.base/java.lang.Thread.run(Thread.java:832)
Comments
[~ccheung]The test fix sounds reasonable to me.
30-05-2018

Without CDS, many of the system classes require default method processing such as: [0.070s][debug][defaultmethods] Interface java.lang.CharSequence requires default method processing With CDS, those system classes will be loaded from the archive and will bypass the default method processing. The test case loads an inner class DefaultMethodsTest$InnerClass which does not require default method processing. A simple fix is to replace the inner class with a simple Hello.class which somehow triggers the default method processing for: [0.429s][debug][defaultmethods] Class jdk.internal.module.SystemModuleFinders$SystemModuleReader$$Lambda$5 requires default method processing
30-05-2018