RFR: 8350982: -server|-client causes fatal exception on static JDK [v2]
Jiangli Zhou
jiangli at openjdk.org
Thu Mar 6 17:57:57 UTC 2025
On Thu, 6 Mar 2025 07:44:43 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> I think the test still serves as a functional test: if an archive is specified, then -Xshare:auto is used by default.
>
> Would it be better to use @requires !jdk.static for now so this test isn't selected when testing static builds? There is work further down the line to figure out a story for static builds + AOT as the ultimate goal is to run jlink and produce a single executable so there wouldn't be a separate AOT cache/archive on the file system. It's much further down the road, not clear that it's worth trying to test intermediate tests with -Xshare:auto at this time.
Looking back at the history, the `-Xshare:auto` & `-server` issue (https://bugs.openjdk.org/browse/JDK-8005933) was related to this code in JDK 8:
https://github.com/openjdk/jdk8u-dev/commit/a1f3a95880318c32169ff89dc8784a0dfc629eec
In JDK 8, on c2 sharedSpaces is disabled if the following condition is true.
!DumpSharedSpaces && !RequireSharedSpaces &&
(FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)
That code no longer exists in mainline. The `-server` option has become a no-op. The launcher code, `CheckJvmType` removes `-server` from the command line arguments passed to the VM side. As a result of those, `-server` is no real impact on CDS now.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23881#discussion_r1983820332
More information about the hotspot-compiler-dev
mailing list