RFR: 8352489: Relax jspawnhelper version checks to informative
Aleksey Shipilev
shade at openjdk.org
Thu Mar 20 11:06:09 UTC 2025
On Thu, 20 Mar 2025 11:00:01 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> src/java.base/unix/native/jspawnhelper/jspawnhelper.c line 160:
>>
>>> 158:
>>> 159: if (strcmp(argv[1], VERSION_STRING) != 0) {
>>> 160: fprintf(stdout, "Incorrect Java version: %s\n", argv[1]);
>>
>> Don't you want to keep the comparison and print the warning if the versions don't match?
>>
>>
>> if (strcmp(argv[1], VERSION_STRING) != 0) {
>> fprintf(stdout, "Warning: Version mismatch: %s != %s\n", argv[1], VERSION_STRING);
>> }
>
> I understand this mismatch is otherwise only printed in `shutItDown`
I was not able to convince myself that printing into `stdout` from jspawnhelper -- when we are not failing -- does not introduce more problems. E.g. if some pipe would be blocked or something wacky like that. So in the interest of extra safety, I only did the version printing from the diagnostic paths where we already print.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24127#discussion_r2005341889
More information about the core-libs-dev
mailing list