Loading... (original) (raw)

test/hotspot/jtreg/runtime/appcds/cacheObject/CheckArchivedModuleApp.java fails with an NPE when JVM is built without JVMCI:

------------------- Test case 1 -------------------
Command line: [myimage/bin/java ... CheckArchivedModuleApp yes yes ]
[ELAPSED: 387 ms]
[logging stdout to ArchivedModuleWithCustomImageTest-0001-custom.runtime.image.run.stdout]
[logging stderr to ArchivedModuleWithCustomImageTest-0001-custom.runtime.image.run.stderr]
[STDERR]
Exception in thread "main" java.lang.NullPointerException
at CheckArchivedModuleApp.main(CheckArchivedModuleApp.java:55)

The following test are affected:
runtime/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java
runtime/appcds/cacheObject/ArchivedModuleComboTest.java

The bug is in the following code:

test/hotspot/jtreg/runtime/appcds/cacheObject/CheckArchivedModuleApp.java:

53 // -XX:+EnableJVMCI adds extra system modules, in which case the system
54 // module objects are not archived.
55 if (wb.getBooleanVMFlag("EnableJVMCI")) {
56 expectArchivedDescriptors = false;
57 expectArchivedConfiguration = false;
58 }

WhiteBox.getBooleanVMFlag() returns null when EnableJVMCI flag is absent.