RFR: 8350982: -server|-client causes fatal exception on static JDK
Alan Bateman
alanb at openjdk.org
Mon Mar 10 19:57:01 UTC 2025
On Tue, 4 Mar 2025 18:48:28 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Please review the `Arguments::parse_each_vm_init_arg` change to ignore`-server|-client` options, which avoids unrecognized option error on static JDK.
>>
>> On regular JDK, '-server|-client' options are processed/removed from command-line arguments by `CheckJvmType` during `CreateExecutionEnvironment`. That happens before `Arguments::parse_each_vm_init_arg` is called. With jvm.cfg setting, only server vm is known and client is ignored. So specifying '-server' and '-client' in command-line is really a no-op.
>>
>> On static JDK, the VM is statically linked with the launcher, and `CreateExecutionEnvironment` & `CheckJvmType` are not called. As the result, `Arguments::parse_each_vm_init_arg` could see `-server|-client` when running on static JDK, if the options are specified in the command line.
>
> Jiangli and I chatted about this today. We don't think there will be developers looking to specify -server or -client to a static image, instead this is more about the tests. So we think the best think is to look at the tests that still specify -server and see if it can be dropped. Some of the tests (say for C2) might be better off using `@requires vm.compiler2.enabled` or `@requires vm.flavor == "server"`.
> @AlanBateman @dholmes-ora @iklam Do you have any other comments/questions about the change? @vnkozlov or others from compiler side, can you please take a look of the change as well? Thanks
I wasn't initially sure about XShareAuto.java but I see the exchange between you and Ioi so I think all good.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23881#issuecomment-2711673676
More information about the hotspot-compiler-dev
mailing list