openj9 icon indicating copy to clipboard operation
openj9 copied to clipboard

openJcePlusTests_0_FAILED InvalidKeySpec Inappropriate key specification: Failed to create XEC private key

Open JasonFengJ9 opened this issue 1 year ago • 9 comments

Failure link

From an internal build(rhel8s390x-svl-rt9-1):

openjdk version "22-beta" 2024-03-19
IBM Semeru Runtime Open Edition 22+36-202403200230 (build 22-beta+36-202403200230)
Eclipse OpenJ9 VM 22+36-202403200230 (build master-7c9937b26, JRE 22 Linux s390x-64-Bit Compressed References 20240320_23 (JIT enabled, AOT enabled)
OpenJ9   - 7c9937b26
OMR      - 1bf2ef421
JCL      - 4803bcabd based on jdk-22+36)

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

Optional info

Failure output (captured from console output)

[2024-03-20T04:09:23.342Z] variation: NoOptions
[2024-03-20T04:09:23.342Z] JVM_OPTIONS:  

[2024-03-20T04:09:23.343Z] TESTING:
[2024-03-20T04:09:25.309Z] Buildfile: /home/jenkins/workspace/Test_openjdk22_j9_extended.functional_s390x_linux_testList_0/jvmtest/functional/OpenJcePlusTests/test.xml

[2024-03-20T04:24:16.798Z]      [test]     [junit] Running gcm_oneReadByteCorrupt test
[2024-03-20T04:24:16.798Z]      [test]     [junit]   Fail. No exception thrown.

[2024-03-20T04:40:39.436Z]      [test]     [junit] Result(should be false): false
[2024-03-20T04:45:09.006Z]      [test]     [junit] Tests run: 1705, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2,082.67 sec
[2024-03-20T04:45:09.006Z]      [test] 
[2024-03-20T04:45:09.006Z]      [test] BUILD FAILED
[2024-03-20T04:45:09.006Z]      [test] /home/jenkins/workspace/Test_openjdk22_j9_extended.functional_s390x_linux_testList_0/jvmtest/functional/OpenJcePlusTests/test.xml:44: Test ibm.jceplus.junit.TestAll failed
[2024-03-20T04:45:09.006Z]      [test] 
[2024-03-20T04:45:09.006Z]      [test] Total time: 35 minutes 34 seconds
[2024-03-20T04:45:09.006Z] 
[2024-03-20T04:45:09.006Z] BUILD FAILED
[2024-03-20T04:45:09.006Z] /home/jenkins/workspace/Test_openjdk22_j9_extended.functional_s390x_linux_testList_0/jvmtest/functional/OpenJcePlusTests/test.xml:33: Java returned: 1
[2024-03-20T04:45:09.006Z] 
[2024-03-20T04:45:09.006Z] Total time: 35 minutes 37 seconds
[2024-03-20T04:45:09.006Z] -----------------------------------
[2024-03-20T04:45:09.006Z] openJcePlusTests_0_FAILED

50x internal grinder - https://github.com/eclipse-openj9/openj9/issues/19205#issuecomment-2013739238

JasonFengJ9 avatar Mar 20 '24 22:03 JasonFengJ9

Grinder succeeded 10/10 on ubu22s390x-svl-rt9-1, ubu22s390x-svl-rt4-1.

Failed 1/10 on ubu22s390x-svl-rt5-1 Failed 1/10 on rhel9s390x-svl-rt3-1 Failed 1/10 on ubu22s390x-rt-1

The following is in the output, but it doesn't cause any failure as the passing runs have it too. I'm not sure what the cause of the Errors: 1 is. I've tried searching the output for different things, but didn't find anything.

20:07:43       [test]     [junit] Running gcm_oneReadByteCorrupt test
20:07:43       [test]     [junit]   Fail. No exception thrown.

@jasonkatonica pls take a look.

pshipton avatar Mar 21 '24 21:03 pshipton

The failures aren't in the 0.44 builds but I assume openJcePlus is the same. Added to the 0.44 milestone for now.

pshipton avatar Mar 21 '24 21:03 pshipton

Grinder succeeded 10/10 on ubu22s390x-svl-rt9-1, ubu22s390x-svl-rt4-1.

Failed 1/10 on ubu22s390x-svl-rt5-1 Failed 1/10 on rhel9s390x-svl-rt3-1 Failed 1/10 on ubu22s390x-rt-1

The following is in the output, but it doesn't cause any failure as the passing runs have it too. I'm not sure what the cause of the Errors: 1 is. I've tried searching the output for different things, but didn't find anything.

20:07:43       [test]     [junit] Running gcm_oneReadByteCorrupt test
20:07:43       [test]     [junit]   Fail. No exception thrown.

@jasonkatonica pls take a look.

The thing that is stated here as a failure is not actually was is causing this intermittent failure. This is a test that needs to be amended, as it is not actually testing what we mean it to, which is the reason why it is only printing this message, instead of throwing an exception. An issue has been opened on our end to fix that.

The issue that is actually causing these failures is:

java.security.spec.InvalidKeySpecException: Inappropriate key specification: Failed to create XEC private key
	at openjceplus/com.ibm.crypto.plus.provider.XDHKeyFactory.engineGeneratePrivate(XDHKeyFactory.java:112)
	at java.base/java.security.KeyFactory.generatePrivate(KeyFactory.java:383)
	at ibm.jceplus.junit.base.BaseTestXDH.runBasicTest(BaseTestXDH.java:246)
	at ibm.jceplus.junit.base.BaseTestXDH.runBasicTests(BaseTestXDH.java:208)
	at ibm.jceplus.junit.base.BaseTestXDH.testXDH_runBasicTests(BaseTestXDH.java:60)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)

We have noticed that happening intermittently throughout our runs and have opened up an issue (see https://github.ibm.com/runtimes/jit-crypto/issues/386) to figure it out and resolve it.

KostasTsiounis avatar Mar 26 '24 19:03 KostasTsiounis

I don't think this is a stop ship issue at the moment. What do you think @jasonkatonica ?

KostasTsiounis avatar Mar 26 '24 19:03 KostasTsiounis

Removed it from the milestone plan.

pshipton avatar Mar 26 '24 20:03 pshipton

I don't think this is a stop ship issue at the moment. What do you think @jasonkatonica ?

Agreed, I dont believe this is a stop ship issue at this time.

jasonkatonica avatar Mar 26 '24 20:03 jasonkatonica

JDK11 x86-64_windows(win19x86-svl-rt5-1)

openjdk version "11.0.23" 2024-04-16
IBM Semeru Runtime Open Edition 11.0.23.0-m2 (build 11.0.23+7)
Eclipse OpenJ9 VM 11.0.23.0-m2 (build v0.44.0-release-8b079b5c1, JRE 11 Windows Server 2019 amd64-64-Bit Compressed References 20240411_884 (JIT enabled, AOT enabled)
OpenJ9   - 8b079b5c1
OMR      - 254af5a04
JCL      - 0f9c69e64d based on jdk-11.0.23+7)

[2024-04-11T21:02:02.977Z]      [test]     [junit] Running gcm_oneReadByteCorrupt test
[2024-04-11T21:02:02.977Z]      [test]     [junit]   Fail. No exception thrown.

[2024-04-11T21:20:21.799Z]      [test]     [junit] Tests run: 1698, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1,213.262 sec
[2024-04-11T21:20:21.799Z]      [test] 
[2024-04-11T21:20:21.799Z]      [test] BUILD FAILED
[2024-04-11T21:20:21.799Z]      [test] C:\Users\jenkins\workspace\Test_openjdk11_j9_extended.functional_x86-64_windows_testList_0\jvmtest\functional\OpenJcePlusTests\test.xml:44: Test ibm.jceplus.junit.TestAll failed
[2024-04-11T21:20:21.799Z]      [test] 
[2024-04-11T21:20:21.799Z]      [test] Total time: 21 minutes 37 seconds
[2024-04-11T21:20:21.799Z] 
[2024-04-11T21:20:21.799Z] BUILD FAILED
[2024-04-11T21:20:21.799Z] C:\Users\jenkins\workspace\Test_openjdk11_j9_extended.functional_x86-64_windows_testList_0\jvmtest\functional\OpenJcePlusTests\test.xml:33: Java returned: 1
[2024-04-11T21:20:21.799Z] 
[2024-04-11T21:20:21.799Z] Total time: 21 minutes 41 seconds
[2024-04-11T21:20:21.799Z] -----------------------------------
[2024-04-11T21:20:21.799Z] openJcePlusTests_0_FAILED

JasonFengJ9 avatar Apr 12 '24 20:04 JasonFengJ9

https://hyc-runtimes-jenkins.swg-devops.com/job/Test_openjdk17_j9_extended.functional_x86-64_windows_testList_1/549/

pshipton avatar Jul 04 '24 03:07 pshipton

JDK11 ppc64_aix_fips140_3_openjceplusfips(p10aix134)

[2024-10-05T04:09:16.634Z] variation: NoOptions
[2024-10-05T04:09:16.634Z] JVM_OPTIONS:   -Dsemeru.fips=true -Dsemeru.customprofile=OpenJCEPlusFIPS

[2024-10-05T04:39:45.897Z] [ERROR] Errors: 
[2024-10-05T04:39:45.897Z] [ERROR]   TestXDH>BaseTestXDH.testXDH_runBasicTests:60->BaseTestXDH.runBasicTests:211->BaseTestXDH.runBasicTest:246 � InvalidKeySpec Inappropriate key specification: Failed to create XEC private key

[2024-10-05T04:39:45.897Z] openJcePlusTests_0_FAILED

JasonFengJ9 avatar Oct 07 '24 20:10 JasonFengJ9

We have addressed the issue stated above :

20:07:43       [test]     [junit] Running gcm_oneReadByteCorrupt test
20:07:43       [test]     [junit]   Fail. No exception thrown.

with a test case update in various OpenJCEPlus releases. This PR is the updates made to the main branch such that we no longer see this error message or the word fail among other improvements made to this specific test.

The intermittant failure with the following:

TestXDH>BaseTestXDH.testXDH_runBasicTests:60->BaseTestXDH.runBasicTests:211->BaseTestXDH.runBasicTest:246 � InvalidKeySpec Inappropriate key specification: Failed to create XEC private key

was also fixed with a OpenJCEPlus update. There was a provider encoding parsing error that was fixed with this PR, once merged we expect that this failure would also be resolved.

jasonkatonica avatar Oct 22 '24 11:10 jasonkatonica

@jasonkatonica just a reminder there is a test excluded label so after the fixes are merged and before this is closed the test needs to be unexcluded.

pshipton avatar Oct 22 '24 12:10 pshipton

OK makes sense there is a test excluded tag. I hadnt noticed it before.

In this particular case the various tests reported above were never excluded from running. One of the test failures was very intermittent when it failed ( BaseTestXDH ) the other test ( message Fail. No exception thrown. ) never really failed, it just did not look correct in the log. So at this point there is no additional updates required to unexclude the tests.

jasonkatonica avatar Oct 22 '24 13:10 jasonkatonica

The test PR wasn't merged.

JasonFengJ9 avatar Oct 22 '24 13:10 JasonFengJ9