RFR: 8279675: CDS cannot handle non-existent JAR file in bootclassapth

Calvin Cheung ccheung at openjdk.java.net
Fri Jan 21 22:39:09 UTC 2022


On Fri, 21 Jan 2022 21:46:35 GMT, Yumin Qi <minqi at openjdk.org> wrote:

>> Non-existent boot class path and file with zero size won't be recorded during CDS dump time.
>> This fix excludes checking of the above paths and files during runtime to avoid a false mismatch.
>> 
>> The proposed fix passed CI tiers 1-4 testing.
>
> src/hotspot/share/cds/filemap.cpp line 868:
> 
>> 866:       return true;   // ok, relaxed check, runtime has extra boot append path entries
>> 867:     } else {
>> 868:       ResourceMark rm;
> 
> Is the ResourceMark necessary here?

Yes, it is needed for `ClasspathStream::get_next` where it does `NEW_RESOURCE_ARRAY`.

> test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java line 225:
> 
>> 223:                 out.shouldNotContain(CLASS_FOUND_MESSAGE)
>> 224:                    .shouldContain(OPTIMIZE_DISABLED)           // mapping info
>> 225:                    .shouldContain("Error: Could not find or load main class .");
> 
> Is the fix changing the behavior for the test? Before fix, "." is seen as -Xbootclasspath/a:., but after fix, it is seen as 'main class'?

I think the behavior after the fix is correct because there's a space between `-Xbootclasspath/a:` and '.'. So the '.'
shouldn't be treated as a path. I also added the following case 11 without the space in between.
`227         tty("11. run with CDS on, --module-path, with -Xbootclasspath/a:.");`

-------------

PR: https://git.openjdk.java.net/jdk/pull/7169


More information about the hotspot-runtime-dev mailing list