RFR: 8325621: Improve jspawnhelper version checks [v2]
Aleksey Shipilev
shade at openjdk.org
Mon Mar 11 19:18:15 UTC 2024
On Mon, 11 Mar 2024 19:12:33 GMT, Chad Rakoczy <duke at openjdk.org> wrote:
>> Fix for [8325621](https://bugs.openjdk.org/browse/JDK-8325621)
>>
>> Updates jspawnhelper to check that JDK version and jspawnhelper version are the same. Updates test to include check for version. Also tested manually by replacing jspawnhelper with incorrect version to confirm that check works.
>
> Chad Rakoczy has updated the pull request incrementally with one additional commit since the last revision:
>
> Code cleanup
src/java.base/unix/native/jspawnhelper/jspawnhelper.c line 173:
> 171: if (jdk_feature != VERSION_FEATURE || jdk_interim != VERSION_INTERIM || jdk_update != VERSION_UPDATE || jdk_patch != VERSION_PATCH) {
> 172: fprintf(stderr, "Expected jspawnhelper for Java %d.%d.%d.%d, ", jdk_feature, jdk_interim, jdk_update, jdk_patch);
> 173: fprintf(stderr, "but jspawnhelper for Java %d.%d.%d.%d was found.\n", VERSION_FEATURE, VERSION_INTERIM, VERSION_UPDATE, VERSION_PATCH);
Minor: It is a bit odd to see that jspawnhelper found its own version odd. I'd say:
fprintf(stderr, "jspawnhelper version check failed. jspawnhelper version: %d.%d.%d.%d, JDK version: %d.%d.%d.%d\n",
VERSION_FEATURE, VERSION_INTERIM, VERSION_UPDATE, VERSION_PATCH,
jdk_feature, jdk_interim, jdk_update, jdk_patch);
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18204#discussion_r1520296858
More information about the build-dev
mailing list