Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jdk_security3_0_FAILED sun/security/tools/keytool/fakegen/DefaultSignatureAlgorithm.java keytool error: java.lang.UnsupportedOperationException #18320

Open
JasonFengJ9 opened this issue Oct 20, 2023 · 8 comments

Comments

@JasonFengJ9
Copy link
Member

JasonFengJ9 commented Oct 20, 2023

Failure link

From an internal build(rhel8-aarch64-3):

java version "11.0.21" 2023-10-17
IBM Semeru Runtime Certified Edition 11.0.21.0 (build 11.0.21+9)
Eclipse OpenJ9 VM 11.0.21.0 (build v0.41.0-release-9c5799b80, JRE 11 Linux aarch64-64-Bit Compressed References 20231018_435 (JIT enabled, AOT enabled)
OpenJ9   - 9c5799b80
OMR      - fa7b6ddc7
JCL      - 6f4cc08025 based on jdk-11.0.21+9)

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

Optional info

Failure output (captured from console output)

[2023-10-19T19:03:59.884Z] variation: Mode150
[2023-10-19T19:03:59.884Z] JVM_OPTIONS:  -XX:+UseCompressedOops 

[2023-10-19T19:39:54.673Z] TEST: sun/security/tools/keytool/fakegen/DefaultSignatureAlgorithm.java

[2023-10-19T19:39:54.679Z] STDERR:
[2023-10-19T19:39:54.679Z]  stdout: [keytool error: java.lang.UnsupportedOperationException
[2023-10-19T19:39:54.679Z] ];
[2023-10-19T19:39:54.679Z]  stderr: []
[2023-10-19T19:39:54.679Z]  exitValue = 1
[2023-10-19T19:39:54.679Z] 
[2023-10-19T19:39:54.679Z] java.lang.RuntimeException: Expected to get exit value of [0]
[2023-10-19T19:39:54.679Z] 
[2023-10-19T19:39:54.679Z] 	at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:431)
[2023-10-19T19:39:54.679Z] 	at DefaultSignatureAlgorithm.check(DefaultSignatureAlgorithm.java:79)
[2023-10-19T19:39:54.679Z] 	at DefaultSignatureAlgorithm.main(DefaultSignatureAlgorithm.java:63)
[2023-10-19T19:39:54.679Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2023-10-19T19:39:54.679Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[2023-10-19T19:39:54.679Z] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2023-10-19T19:39:54.679Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[2023-10-19T19:39:54.679Z] 	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
[2023-10-19T19:39:54.679Z] 	at java.base/java.lang.Thread.run(Thread.java:839)
[2023-10-19T19:39:54.679Z] 
[2023-10-19T19:39:54.679Z] JavaTest Message: Test threw exception: java.lang.RuntimeException: Expected to get exit value of [0]

[2023-10-19T19:39:54.680Z] TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Expected to get exit value of [0]
[2023-10-19T19:39:54.680Z] --------------------------------------------------
[2023-10-19T19:50:43.328Z] Test results: passed: 769; failed: 1
[2023-10-19T19:51:04.217Z] Report written to /home/jenkins/workspace/Test_openjdk11_j9_extended.openjdk_aarch64_linux_testList_0/aqa-tests/TKG/output_16977422384907/jdk_security3_0/report/html/report.html
[2023-10-19T19:51:04.217Z] Results written to /home/jenkins/workspace/Test_openjdk11_j9_extended.openjdk_aarch64_linux_testList_0/aqa-tests/TKG/output_16977422384907/jdk_security3_0/work
[2023-10-19T19:51:04.217Z] Error: Some tests failed or other problems occurred.
[2023-10-19T19:51:04.217Z] -----------------------------------
[2023-10-19T19:51:04.217Z] jdk_security3_0_FAILED

50x internal grinder - failed at rhel8-aarch64-6, might be a machine setup issue

@JasonFengJ9
Copy link
Member Author

JDK11 ppc64le_linux(rhel8le-rtp-rt3-1)

java version "11.0.21" 2023-10-17
IBM Semeru Runtime Certified Edition 11.0.21.0-rc2 (build 11.0.21+9)
Eclipse OpenJ9 VM 11.0.21.0-rc2 (build v0.41.0-release-a803f004b, JRE 11 Linux ppc64le-64-Bit Compressed References 20231116_717 (JIT enabled, AOT enabled)
OpenJ9   - a803f004b
OMR      - 5eee6ad9d
JCL      - 6f4cc08025 based on jdk-11.0.21+9)

[2023-11-16T21:42:05.618Z] variation: Mode150
[2023-11-16T21:42:05.618Z] JVM_OPTIONS:  -XX:+UseCompressedOops 

[2023-11-16T22:25:10.672Z] TEST: sun/security/tools/keytool/fakegen/DefaultSignatureAlgorithm.java

[2023-11-16T22:25:10.677Z] STDERR:
[2023-11-16T22:25:10.677Z]  stdout: [keytool error: java.lang.UnsupportedOperationException
[2023-11-16T22:25:10.677Z] ];
[2023-11-16T22:25:10.677Z]  stderr: []
[2023-11-16T22:25:10.677Z]  exitValue = 1
[2023-11-16T22:25:10.677Z] 
[2023-11-16T22:25:10.677Z] java.lang.RuntimeException: Expected to get exit value of [0]
[2023-11-16T22:25:10.677Z] 
[2023-11-16T22:25:10.677Z] 	at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:431)
[2023-11-16T22:25:10.677Z] 	at DefaultSignatureAlgorithm.check(DefaultSignatureAlgorithm.java:79)
[2023-11-16T22:25:10.677Z] 	at DefaultSignatureAlgorithm.main(DefaultSignatureAlgorithm.java:63)
[2023-11-16T22:25:10.677Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2023-11-16T22:25:10.677Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[2023-11-16T22:25:10.677Z] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2023-11-16T22:25:10.677Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[2023-11-16T22:25:10.677Z] 	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
[2023-11-16T22:25:10.678Z] 	at java.base/java.lang.Thread.run(Thread.java:839)
[2023-11-16T22:25:10.678Z] 
[2023-11-16T22:25:10.678Z] JavaTest Message: Test threw exception: java.lang.RuntimeException: Expected to get exit value of [0]

[2023-11-16T22:34:25.662Z] jdk_security3_0_FAILED

50x internal grinder

@JasonFengJ9
Copy link
Member Author

JasonFengJ9 commented Mar 1, 2024

JDK11 ppc64le_linux(cent8le-svl-rt8-1)

java version "11.0.23-beta" 2024-04-16
IBM Semeru Runtime Certified Edition 11.0.23+5-202402292307 (build 11.0.23-beta+5-202402292307)
Eclipse OpenJ9 VM 11.0.23+5-202402292307 (build master-2095c8e18, JRE 11 Linux ppc64le-64-Bit Compressed References 20240229_794 (JIT enabled, AOT enabled)
OpenJ9   - 2095c8e18
OMR      - 9235a2ff6
JCL      - 7acd29681d based on jdk-11.0.23+5)

[2024-02-29T23:56:41.758Z] variation: Mode150
[2024-02-29T23:56:41.758Z] JVM_OPTIONS:  -XX:+UseCompressedOops -Xverbosegclog 

[2024-03-01T00:48:45.310Z] TEST: sun/security/tools/keytool/fakegen/DefaultSignatureAlgorithm.java

[2024-03-01T00:48:45.314Z] STDERR:
[2024-03-01T00:48:45.314Z]  stdout: [keytool error: java.lang.UnsupportedOperationException
[2024-03-01T00:48:45.314Z] ];
[2024-03-01T00:48:45.314Z]  stderr: []
[2024-03-01T00:48:45.314Z]  exitValue = 1
[2024-03-01T00:48:45.314Z] 
[2024-03-01T00:48:45.314Z] java.lang.RuntimeException: Expected to get exit value of [0]
[2024-03-01T00:48:45.314Z] 
[2024-03-01T00:48:45.314Z] 	at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:431)
[2024-03-01T00:48:45.314Z] 	at DefaultSignatureAlgorithm.check(DefaultSignatureAlgorithm.java:79)
[2024-03-01T00:48:45.314Z] 	at DefaultSignatureAlgorithm.main(DefaultSignatureAlgorithm.java:63)
[2024-03-01T00:48:45.314Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2024-03-01T00:48:45.314Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[2024-03-01T00:48:45.314Z] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2024-03-01T00:48:45.314Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:572)
[2024-03-01T00:48:45.314Z] 	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
[2024-03-01T00:48:45.314Z] 	at java.base/java.lang.Thread.run(Thread.java:839)
[2024-03-01T00:48:45.314Z] 
[2024-03-01T00:48:45.314Z] JavaTest Message: Test threw exception: java.lang.RuntimeException: Expected to get exit value of [0]

50x grinder - 10/50 failed all in cent8le-rtp-rt1-1

Also occurred at JDK11 s390x_linux(rhel8s390x-svl-rt7-1)

@pshipton
Copy link
Member

pshipton commented Mar 4, 2024

@jasonkatonica we need some help to determine what the problem is. If it's a problem with the machines we should get them updated so the test can pass.

@JasonFengJ9
Copy link
Member Author

JDK11 aarch64_linux(rhel8-aarch64-5)

openjdk version "11.0.23" 2024-04-16
IBM Semeru Runtime Open Edition 11.0.23.0-m1 (build 11.0.23+6)
Eclipse OpenJ9 VM 11.0.23.0-m1 (build v0.44.0-release-747f86c91, JRE 11 Linux aarch64-64-Bit Compressed References 20240319_907 (JIT enabled, AOT enabled)
OpenJ9   - 747f86c91
OMR      - 254af5a04
JCL      - b59f8e52b5 based on jdk-11.0.23+6)

[2024-03-20T20:33:43.429Z] variation: Mode650
[2024-03-20T20:33:43.429Z] JVM_OPTIONS:  -XX:-UseCompressedOops -Xverbosegclog 

[2024-03-20T20:59:10.750Z] TEST: sun/security/tools/keytool/fakegen/DefaultSignatureAlgorithm.java

[2024-03-20T20:59:10.752Z] STDERR:
[2024-03-20T20:59:10.752Z]  stdout: [keytool error: java.lang.UnsupportedOperationException
[2024-03-20T20:59:10.752Z] ];
[2024-03-20T20:59:10.752Z]  stderr: []
[2024-03-20T20:59:10.752Z]  exitValue = 1
[2024-03-20T20:59:10.752Z] 
[2024-03-20T20:59:10.752Z] java.lang.RuntimeException: Expected to get exit value of [0]
[2024-03-20T20:59:10.752Z] 
[2024-03-20T20:59:10.752Z] 	at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:431)
[2024-03-20T20:59:10.752Z] 	at DefaultSignatureAlgorithm.check(DefaultSignatureAlgorithm.java:79)
[2024-03-20T20:59:10.752Z] 	at DefaultSignatureAlgorithm.main(DefaultSignatureAlgorithm.java:63)

[2024-03-20T20:59:10.752Z] TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Expected to get exit value of [0]
[2024-03-20T20:59:10.753Z] --------------------------------------------------
[2024-03-20T21:07:35.009Z] Test results: passed: 764; failed: 1
[2024-03-20T21:07:35.009Z] Report written to /home/jenkins/workspace/Test_openjdk11_j9_extended.openjdk_aarch64_linux_testList_1/aqa-tests/TKG/output_17109657691482/jdk_security3_1/report/html/report.html
[2024-03-20T21:07:35.009Z] Results written to /home/jenkins/workspace/Test_openjdk11_j9_extended.openjdk_aarch64_linux_testList_1/aqa-tests/TKG/output_17109657691482/jdk_security3_1/work
[2024-03-20T21:07:35.009Z] Error: Some tests failed or other problems occurred.
[2024-03-20T21:07:35.009Z] -----------------------------------
[2024-03-20T21:07:35.009Z] jdk_security3_1_FAILED

@JinhangZhang
Copy link

rhel8-aarch64-3, rhel8-aarch64-5, rhel8-aarch64-6, cent8le-rtp-rt1-1, cent8le-svl-rt8-1, rhel8le-rtp-rt3-1 and rhel8s390x-svl-rt7-1 are Redhat machines. The openssl version used in those machines is
OpenSSL 1.1.1k FIPS 25 Mar 2021
This is a FIPS version of openssl.

Normally, when we use keytool to generate keypairs, the native code from openssl will be loaded and used at first. If the native code is not satisfied, then the jave implementation will be used.

DefaultSignatureAlgorithm test run in those Redhat machines, and the openssl used in those machines is a FIPS certified. So, a 192 size of EC key pair generator is not allowed by the native code in FIPS mode, then a Java implementation is used. But in the DefaultSignatureAlgorithm test code, there is no implementation of the initialize in the patched ECKeyPairGenerator.java file. Therefore, the test throws an UnsupportedOperationException exception.

I run the DefaultSignatureAlgorithm test in my redhat fyre machine with OpenSSL 1.1.1k, it passed.

Therefore, this is not a blocking issue, this could be a machine issue.

@pshipton
Copy link
Member

Created infrastructure/issues/9147

@keithc-ca
Copy link
Contributor

there is no implementation of the initialize in the patched ECKeyPairGenerator.java file

@JinhangZhang Why do you refer to that file as "patched"? The file test/jdk/sun/security/tools/keytool/fakegen/jdk.crypto.ec/sun/security/ec/ECKeyPairGenerator.java is identical to upstream (in all versions unless ibmruntimes/openj9-openjdk-jdk11#779 is accepted).

Did you mean to refer instead to src/jdk.crypto.ec/share/classes/sun/security/ec/ECKeyPairGenerator.java?However, the only change to the latter file is to increase the visibility of ensureCurveIsSupported(ECParameterSpec) (by removing the private modifier).

@JinhangZhang
Copy link

Keytool command inside DefaultSignatureAlgorithm.java file use test/jdk/sun/security/tools/keytool/fakegen/jdk.crypto.ec/sun/security/ec/ECKeyPairGenerator.java as a patch.

@JinhangZhang Why do you refer to that file as "patched"? The file test/jdk/sun/security/tools/keytool/fakegen/jdk.crypto.ec/sun/security/ec/ECKeyPairGenerator.java is identical to upstream (in all versions unless ibmruntimes/openj9-openjdk-jdk11#779 is accepted).

JinhangZhang added a commit to JinhangZhang/openj9-openjdk-jdk11 that referenced this issue May 14, 2024
This patch eliminates the 192-bit EC test which causes exceptions
seen in issue #18320.

DefaultSignatureAlgorithm test was run in those Redhat OS based machines
in a non-FIPS mode, but with a FIPS version of openssl. So, a 192-bit
size of EC key pair generator is not allowed by the native code in a
FIPS version of openssl. The code path went to a replacement EC key-pair
generator Java implementation.

issue: eclipse-openj9/openj9#18320
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants