RFR: 8351689: -Xshare:dump with default classlist fails on static JDK

Ioi Lam iklam at openjdk.org
Thu Mar 13 21:25:52 UTC 2025


On Tue, 11 Mar 2025 20:52:59 GMT, Jiangli Zhou <jiangli at openjdk.org> wrote:

> Please review the change to use `Arguments::get_java_home` to resolve the default classlist path. This avoids the complication of walking up the directory from libjvm and the subtle handling for '/lib' dir, which is what `MetaspaceShared::get_default_classlist` needs to do. This fixes the failure on static JDK for running `-Xshare:dump` with the default classlist. Please see more details in https://bugs.openjdk.org/browse/JDK-8351689.

Have you tested on different platforms, especially Windows? Some CDS tests that use `MetaspaceShared::get_default_classlist)` may not be tested in the GitHub actions.

src/hotspot/share/cds/metaspaceShared.cpp line 869:

> 867: 
> 868:   jio_snprintf(default_classlist, JVM_MAXPATHLEN, "%s%slib%sclasslist",
> 869:                Arguments::get_java_home(), filesep, filesep);

I think it's better to move this logic into `MetaspaceShared::get_default_classlist()` to avoid duplication.

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

PR Review: https://git.openjdk.org/jdk/pull/24000#pullrequestreview-2683388567
PR Review Comment: https://git.openjdk.org/jdk/pull/24000#discussion_r1994317680


More information about the hotspot-runtime-dev mailing list