openj9 icon indicating copy to clipboard operation
openj9 copied to clipboard

jdk_security3_0 sun/security/pkcs12/KeytoolOpensslInteropTest.java#GenerateOpensslPKCS12 NullPointerException: Cannot invoke "java.nio.file.Path.getParent()" because the return value of "java.nio.file.Path.getParent()" is null

Open JasonFengJ9 opened this issue 6 months ago • 4 comments

Failure link

From internal Test_openjdk21_j9_extended.openjdk_x86-64_windows_testList_1 (win11x86-rtp-rt1-1)

java version "21.0.8-beta" 2025-07-15
IBM Semeru Runtime Certified Edition 21.0.8+4-202505250143 (build 21.0.8-beta+4-202505250143)
Eclipse OpenJ9 VM 21.0.8+4-202505250143 (build master-7bed029788, JRE 21 Windows 11 amd64-64-Bit Compressed References 20250525_454 (JIT enabled, AOT enabled)
OpenJ9   - 7bed029788
OMR      - 988ae21a0
JCL      - c7fc9b6a9 based on jdk-21.0.8+4)

Rerun in Grinder - Change TARGET to run only the failed test targets

Optional info

Failure output (captured from console output)

[2025-05-25T11:13:33.352Z] variation: Mode150
[2025-05-25T11:13:33.784Z] JVM_OPTIONS:  -XX:+UseCompressedOops -Xverbosegclog 

[2025-05-25T12:56:49.140Z] TEST: sun/security/pkcs12/KeytoolOpensslInteropTest.java#GenerateOpensslPKCS12

[2025-05-25T12:56:49.143Z] TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.getParent()" because the return value of "java.nio.file.Path.getParent()" is null
[2025-05-25T12:56:49.143Z] --------------------------------------------------
[2025-05-25T15:11:44.070Z] Test results: passed: 952; failed: 1

[2025-05-25T15:12:18.987Z] jdk_security3_0_FAILED
19:22:48  java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.getParent()" because the return value of "java.nio.file.Path.getParent()" is null
19:22:48  	at jdk.test.lib.security.OpensslArtifactFetcher.getProviderPath(OpensslArtifactFetcher.java:136)
19:22:48  	at KeytoolOpensslInteropTest.generateInitialKeystores(KeytoolOpensslInteropTest.java:121)
19:22:48  	at KeytoolOpensslInteropTest.main(KeytoolOpensslInteropTest.java:88)

50x internal Grinder - failed every run on win11x86-rtp-rt8-1

JasonFengJ9 avatar May 27 '25 21:05 JasonFengJ9

openjdk17_j9_extended.openjdk_x86-64_windows

[2025-05-30T16:37:49.992Z] variation: Mode650
[2025-05-30T16:37:50.802Z] JVM_OPTIONS:  -XX:-UseCompressedOops -Xverbosegclog 

[2025-05-30T18:09:18.134Z] TEST: sun/security/pkcs12/KeytoolOpensslInteropTest.java#GenerateOpensslPKCS12

[2025-05-30T18:09:18.158Z] STDERR:
[2025-05-30T18:09:18.158Z] java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.getParent()" because the return value of "java.nio.file.Path.getParent()" is null
[2025-05-30T18:09:18.158Z] 	at jdk.test.lib.security.OpensslArtifactFetcher.getProviderPath(OpensslArtifactFetcher.java:136)
[2025-05-30T18:09:18.158Z] 	at KeytoolOpensslInteropTest.generateInitialKeystores(KeytoolOpensslInteropTest.java:121)
[2025-05-30T18:09:18.158Z] 	at KeytoolOpensslInteropTest.main(KeytoolOpensslInteropTest.java:88)

[2025-05-30T20:10:49.514Z] Test results: passed: 881; failed: 1

[2025-05-30T20:11:15.412Z] jdk_security3_1_FAILED

JasonFengJ9 avatar Jun 04 '25 02:06 JasonFengJ9

Set as a blocker assuming it's a regression from the last release.

pshipton avatar Jun 09 '25 15:06 pshipton

Actually this seems more like it could be a machine or test problem since it failed consistently on one machine but not the others.

pshipton avatar Jun 09 '25 15:06 pshipton

Output shows:

23:22:26  System Property - test.openssl.path: null
23:22:26  Command line: [openssl version]
23:22:26  [2025-05-28T03:22:12.766963100Z] Gathering output for process 2784
23:22:26  [2025-05-28T03:22:12.845119800Z] Waiting for completion for process 2784
23:22:26  [2025-05-28T03:22:12.938880800Z] Waiting for completion finished for process 2784
23:22:26  Output and diagnostic info for process 2784 was saved into 'pid-2784-output.log'
23:22:26  OpenSSL 3.0.14 4 Jun 2024 (Library: OpenSSL 3.0.14 4 Jun 2024)

Looking at https://github.com/ibmruntimes/openj9-openjdk-jdk21/blob/openj9/test/lib/jdk/test/lib/security/OpensslArtifactFetcher.java#L93 it seems if openssl is a binary on the PATH then it's going to get a NullPointerException at https://github.com/ibmruntimes/openj9-openjdk-jdk21/blob/openj9/test/lib/jdk/test/lib/security/OpensslArtifactFetcher.java#L92 since it doesn't have a full path to run getParent().getParent().

pshipton avatar Jun 09 '25 16:06 pshipton

Opened https://github.ibm.com/runtimes/infrastructure/issues/10909

pshipton avatar Jul 04 '25 16:07 pshipton

Turns out all machines have openssl (as part of cygwin). The test fails when openssl 3.0.14 is found, but is skipped and passes for any other version. Seems the test can only pass when openssl and the ossl-modules directory is arranged in an expected structure and test.openssl.path is set to the path of that structure.

jtreg.SkippedException: Can't find the version: 3.0.14 of openssl binary on this machine, please install and set openssl path with property 'test.openssl.path'

pshipton avatar Jul 09 '25 18:07 pshipton

Created https://github.com/adoptium/aqa-tests/pull/6394 to permanently exclude the test.

pshipton avatar Jul 09 '25 18:07 pshipton

Additional failed test mode sun/security/pkcs12/KeytoolOpensslInteropTest.java#UseExistingPKCS12:

zOS JDK17(fyrec21l):

04:37:28  java version "17.0.16-internal" 2025-07-15
04:37:28  IBM Semeru Runtime Certified Edition for z/OS (build 17.0.16-internal+0-adhoc.JENKINS.BuildJDK17s390xzosNightly)
04:37:28  IBM J9 VM (build ibm_sdk-a29d4b0c0ac, JRE 17 z/OS s390x-64-Bit Compressed References 20250721_1108 (JIT enabled, AOT enabled)
04:37:28  OpenJ9   - a29d4b0c0ac
04:37:28  OMR      - 7a3903bc8ec
04:37:28  IBM      - 8e661b7a7a6
04:37:28  JCL      - 173544eed96 based on jdk-17.0.16+8)

04:41:05  Running test jdk_custom_0 ...
04:41:06  ===============================================
04:41:07  jdk_custom_0 Start Time: Mon Jul 21 08:41:06 2025 Epoch Time (ms): 1753087266938
04:41:08  variation: NoOptions
04:41:09  JVM_OPTIONS:  -Xverbosegclog -Dcom.ibm.tools.attach.enable=yes

04:41:27  TEST: sun/security/pkcs12/KeytoolOpensslInteropTest.java#UseExistingPKCS12

04:41:27  STDOUT:
04:41:27  java.security.KeyStoreException: Unrecognized keystore format. Please load it with a specified type
04:41:27  	at java.base/java.security.KeyStore.getInstance(KeyStore.java:1808)
04:41:27  	at java.base/java.security.KeyStore.getInstance(KeyStore.java:1681)
04:41:27  	at KeytoolOpensslInteropTest.check(KeytoolOpensslInteropTest.java:570)
04:41:27  	at KeytoolOpensslInteropTest.testWithJavaCommands(KeytoolOpensslInteropTest.java:159)
04:41:27  	at KeytoolOpensslInteropTest.main(KeytoolOpensslInteropTest.java:115)
04:41:27  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
04:41:27  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
04:41:27  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
04:41:27  	at java.base/java.lang.reflect.Method.invoke(Method.java:575)
04:41:27  	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
04:41:27  	at java.base/java.lang.Thread.run(Thread.java:853)
04:41:27  STDERR:
04:41:27  java.lang.RuntimeException: os2-a-null-changeit-load expected: true but was: class java.security.KeyStoreException
04:41:27  	at jdk.test.lib.Asserts.fail(Asserts.java:591)
04:41:27  	at jdk.test.lib.Asserts.assertEquals(Asserts.java:202)
04:41:27  	at jdk.test.lib.Asserts.assertEQ(Asserts.java:178)
04:41:27  	at KeytoolOpensslInteropTest.check(KeytoolOpensslInteropTest.java:577)
04:41:27  	at KeytoolOpensslInteropTest.testWithJavaCommands(KeytoolOpensslInteropTest.java:159)
04:41:27  	at KeytoolOpensslInteropTest.main(KeytoolOpensslInteropTest.java:115)
04:41:27  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
04:41:27  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
04:41:27  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
04:41:27  	at java.base/java.lang.reflect.Method.invoke(Method.java:575)
04:41:27  	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
04:41:27  	at java.base/java.lang.Thread.run(Thread.java:853)
04:41:27  
04:41:27  JavaTest Message: Test threw exception: java.lang.RuntimeException: os2-a-null-changeit-load expected: true but was: class java.security.KeyStoreException

This failure is also observed at https://github.com/eclipse-openj9/openj9/issues/21996#issuecomment-2937260287

openjdk17_j9_extended.openjdk_ppc64_aix_fips140_3_openjceplusfips.fips140-3

[2025-05-30T17:42:38.322Z] variation: Mode150
[2025-05-30T17:42:38.322Z] JVM_OPTIONS:  -XX:+UseCompressedOops -Xverbosegclog  -Dsemeru.fips=true -Dsemeru.customprofile=OpenJCEPlusFIPS.FIPS140-3

[2025-05-30T17:51:48.305Z] TEST: sun/security/pkcs12/KeytoolOpensslInteropTest.java#UseExistingPKCS12

2025-05-30T17:51:48.330Z] STDOUT:
[2025-05-30T17:51:48.330Z] java.security.KeyStoreException: Unrecognized keystore format. Please load it with a specified type
[2025-05-30T17:51:48.330Z] 	at java.base/java.security.KeyStore.getInstance(KeyStore.java:1808)
[2025-05-30T17:51:48.330Z] 	at java.base/java.security.KeyStore.getInstance(KeyStore.java:1681)
[2025-05-30T17:51:48.330Z] 	at KeytoolOpensslInteropTest.check(KeytoolOpensslInteropTest.java:570)
[2025-05-30T17:51:48.330Z] 	at KeytoolOpensslInteropTest.testWithJavaCommands(KeytoolOpensslInteropTest.java:159)
[2025-05-30T17:51:48.330Z] 	at KeytoolOpensslInteropTest.main(KeytoolOpensslInteropTest.java:115)
[2025-05-30T17:51:48.330Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[2025-05-30T17:51:48.330Z] STDERR:
[2025-05-30T17:51:48.330Z] java.lang.RuntimeException: os2-a-null-changeit-load expected: true but was: class java.security.KeyStoreException
[2025-05-30T17:51:48.330Z] 	at jdk.test.lib.Asserts.fail(Asserts.java:591)
[2025-05-30T17:51:48.330Z] 	at jdk.test.lib.Asserts.assertEquals(Asserts.java:202)
[2025-05-30T17:51:48.330Z] 	at jdk.test.lib.Asserts.assertEQ(Asserts.java:178)
[2025-05-30T17:51:48.330Z] 	at KeytoolOpensslInteropTest.check(KeytoolOpensslInteropTest.java:577)
[2025-05-30T17:51:48.330Z] 	at KeytoolOpensslInteropTest.testWithJavaCommands(KeytoolOpensslInteropTest.java:159)
[2025-05-30T17:51:48.330Z] 	at KeytoolOpensslInteropTest.main(KeytoolOpensslInteropTest.java:115)

[2025-05-30T18:16:57.442Z] jdk_security3_0_FAILED

JasonFengJ9 avatar Jul 21 '25 13:07 JasonFengJ9

Jason, pls open a separate issue for the previous. "Unrecognized keystore format" looks different from the original NullPointerException this issue was opened for. We should investigate the "Unrecognized keystore format", although you can still exclude it for now under the new issue.

pshipton avatar Jul 21 '25 14:07 pshipton

Sure, opened

  • https://github.com/eclipse-openj9/openj9/issues/22262

JasonFengJ9 avatar Jul 21 '25 14:07 JasonFengJ9