RFR: 8339460: CDS error when module is located in a directory with space in the name
Calvin Cheung
ccheung at openjdk.org
Mon Sep 23 22:58:34 UTC 2024
On Fri, 13 Sep 2024 08:04:58 GMT, Maxim Kartashev <mkartashev at openjdk.org> wrote:
> The crux of the problem is that path names in CDS are saved as URIs and subsequently "converted" back to path names simply by stripping off the prefix without appropriate conversion of the rest of the name. This commit adds such a conversion.
Thanks for fixing this bug. I've re-assigned the bug to you. Couple of comments below.
src/hotspot/share/classfile/classLoader.cpp line 1236:
> 1234: if (str[index] == '%'
> 1235: && isxdigit(str[index + 1])
> 1236: && isxdigit(str[index + 2])) {
I think you need to bound check the index because the `uri` from `ClassLoaderExt::process_module_table `could just be a directory name, e.g. dir%, without the jar file name.
test/hotspot/jtreg/runtime/cds/appcds/complexURI/ComplexURITest.java line 46:
> 44: public class ComplexURITest {
> 45: final static String listFileName = "test-classlist.txt";
> 46: final static String archiveName = "test-dynamic.jsa";
You're using the same `archiveName` for both static and dynamic test cases. I'd suggest declare a different archive name for the static case. E.g.
final static String staticArchiveName = "test-static.jsa";
final static String dynamicArchiveName = "test-dynamic.jsa";
Also, I think this test should be excluded from the `hotspot_appcds_dynamic` test group in the `open/test/hotspot/jtreg/TEST.groups` file.
-------------
Changes requested by ccheung (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/20987#pullrequestreview-2323649353
PR Review Comment: https://git.openjdk.org/jdk/pull/20987#discussion_r1772311976
PR Review Comment: https://git.openjdk.org/jdk/pull/20987#discussion_r1772316265
More information about the hotspot-runtime-dev
mailing list