JDK-8154239 : -Xbootclasspath/a breaks exploded build
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-04-14
  • Updated: 2022-11-04
  • Resolved: 2016-07-26
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 9
9 b131Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
With -Xbootclasspath/a:<path> specified the VM can't find classes in exploded modules. The problem is that <path> is prepended to the list of exploded modules:

(lldb) p ClassLoader::print_bootclasspath()
[bootclasspath= .../jdk/modules/java.base ;<path> ;.../jdk/modules/java.logging ;... ;.../jdk/modules/java.xml ;]

and ClassLoader::load_class() doesn't look past java.base:

ClassLoader::load_class(name=..., search_append_only=false, ...)

  ClassPathEntry* e = (search_append_only ? _first_append_entry : _first_entry);
  ClassPathEntry* last_e =
      (search_append_only || DumpSharedSpaces ? NULL : _first_append_entry);

    while ((e != NULL) && (e != last_e)) {
...
       e = e->next();
      ++classpath_index;
    }
  }

where:
  _first_entry == java.base
  _first_append_entry = <path>

Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/7033b767fd7c User: lana Date: 2016-08-10 20:19:27 +0000
10-08-2016

URL: http://hg.openjdk.java.net/jdk9/hs/hotspot/rev/7033b767fd7c User: lfoltan Date: 2016-07-26 16:09:53 +0000
26-07-2016

This breaks a lot of jtreg tests. For instance all the tests below fail when run with an exploded image but pass with an image build. Simply reporting an error when trying to use Xbootclasspath/a with an exploded image would be better than the current state. FAILED: closed/compiler/compilercontrol/DontInlineCommandTest.java FAILED: closed/compiler/compilercontrol/DontInlineDirectiveTest.java FAILED: closed/compiler/compilercontrol/InlineCommandTest.java FAILED: closed/compiler/compilercontrol/InlineDirectiveTest.java FAILED: closed/compiler/compilercontrol/InlineDontInlineMixedTest.java FAILED: closed/compiler/compilercontrol/RandomValidCommandsTest.java FAILED: closed/gc/cmm/TestHeapUnderMemoryPressure.java FAILED: closed/gc/resource/TestAccuracyLevel.java FAILED: closed/gc/resource/TestInternedStrings.java FAILED: closed/gc/resource/TestOutOfMemory.java FAILED: closed/gc/resource/TestPendingData.java FAILED: closed/gc/resource/TestReassignOnDestroyContext.java FAILED: closed/gc/resource/TestReusedDestroyedContext.java FAILED: closed/gc/resource/TestVerifyContexts.java FAILED: compiler/codecache/jmx/BeanTypeTest.java FAILED: compiler/codecache/jmx/CodeHeapBeanPresenceTest.java FAILED: compiler/codecache/jmx/GetUsageTest.java FAILED: compiler/codecache/jmx/InitialAndMaxUsageTest.java FAILED: compiler/codecache/jmx/ManagerNamesTest.java FAILED: compiler/codecache/jmx/MemoryPoolsPresenceTest.java FAILED: compiler/codecache/jmx/PoolsIndependenceTest.java FAILED: compiler/codecache/jmx/ThresholdNotificationsTest.java FAILED: compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java FAILED: compiler/codecache/jmx/UsageThresholdExceededTest.java FAILED: compiler/codecache/jmx/UsageThresholdIncreasedTest.java FAILED: compiler/codecache/jmx/UsageThresholdNotExceededTest.java FAILED: compiler/codecache/OverflowCodeCacheTest.java FAILED: compiler/codecache/stress/RandomAllocationTest.java FAILED: compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java FAILED: compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java FAILED: compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java FAILED: compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java FAILED: compiler/jvmci/compilerToVM/AllocateCompileIdTest.java FAILED: compiler/jvmci/compilerToVM/CanInlineMethodTest.java FAILED: compiler/jvmci/compilerToVM/DebugOutputTest.java FAILED: compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java FAILED: compiler/jvmci/compilerToVM/GetConstantPoolTest.java FAILED: compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java FAILED: compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java FAILED: compiler/jvmci/compilerToVM/IsMatureTest.java FAILED: compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java FAILED: compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java FAILED: compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java FAILED: compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java FAILED: compiler/jvmci/compilerToVM/LookupNameInPoolTest.java FAILED: compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java FAILED: compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java FAILED: compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java FAILED: compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java FAILED: compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java FAILED: compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java FAILED: compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java FAILED: compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java FAILED: compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java FAILED: compiler/jvmci/meta/StableFieldTest.java FAILED: compiler/tiered/ConstantGettersTransitionsTest.java FAILED: compiler/whitebox/AllocationCodeBlobTest.java FAILED: compiler/whitebox/ForceNMethodSweepTest.java FAILED: compiler/whitebox/GetCodeHeapEntriesTest.java FAILED: gc/arguments/TestMinAndInitialSurvivorRatioFlags.java FAILED: gc/arguments/TestNewRatioFlag.java FAILED: gc/arguments/TestNewSizeFlags.java FAILED: gc/arguments/TestSurvivorRatioFlag.java FAILED: gc/arguments/TestTargetSurvivorRatioFlag.java FAILED: gc/g1/humongousObjects/TestHeapCounters.java FAILED: gc/g1/TestShrinkAuxiliaryData00.java FAILED: gc/g1/TestShrinkAuxiliaryData05.java FAILED: gc/g1/TestShrinkAuxiliaryData10.java FAILED: gc/g1/TestShrinkAuxiliaryData15.java FAILED: gc/g1/TestShrinkAuxiliaryData20.java FAILED: gc/survivorAlignment/TestAllocationInEden.java FAILED: gc/survivorAlignment/TestPromotionFromEdenToTenured.java FAILED: gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java FAILED: gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java FAILED: runtime/modules/Xpatch/XpatchTraceCL.java
24-06-2016

I was bitten by this today and wasted hours before realizing this is a limitation of exploded images. +100 for a fix!
23-06-2016

There have been several reports of this and so would be good to fix in JDK 9 soon if possible.
25-05-2016

jdk/test/java/lang/Package/annotation/PackageInfoTest.java fails when running with exploded image but passed with a run-time image. I nailed down to a small test case that class Test defined by the boot loader finding all methods in p.PackageInfoTest class that is defined by application class loader (see the source below). It fails to find a class in java.compiler module that is defined by the boot loader. This only happens when running from an exploded image and seems related to this issue. $ java -Xbootclasspath/a:boot -cp . Test Exception in thread "main" java.lang.NoClassDefFoundError: javax/tools/JavaFileManager at java.lang.Class.getDeclaredMethods0(java.base/Native Method) at java.lang.Class.privateGetDeclaredMethods(java.base/Class.java:2937) at java.lang.Class.privateGetPublicMethods(java.base/Class.java:3138) at java.lang.Class.getMethods(java.base/Class.java:1792) at Test.main(Test.java:11) Caused by: java.lang.ClassNotFoundException: javax.tools.JavaFileManager at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base/BuiltinClassLoader.java:366) at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base/ClassLoaders.java:184) at java.lang.ClassLoader.loadClass(java.base/ClassLoader.java:419) ... 5 more
21-04-2016