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 IOException: NSS initialization failed #17137

Open
JasonFengJ9 opened this issue Apr 10, 2023 · 10 comments
Open

jdk_security3_0_FAILED IOException: NSS initialization failed #17137

JasonFengJ9 opened this issue Apr 10, 2023 · 10 comments

Comments

@JasonFengJ9
Copy link
Member

JasonFengJ9 commented Apr 10, 2023

Failure link

From an internal build(rhel9lert-2):

java version "17.0.7" 2023-04-18
IBM Semeru Runtime Certified Edition 17.0.7+5 (build 17.0.7+5)
Eclipse OpenJ9 VM 17.0.7+5 (build master-ab86d5ac7, JRE 17 Linux ppc64le-64-Bit Compressed References 20230418_375 (JIT enabled, AOT enabled)
OpenJ9   - ab86d5ac7
OMR      - 2d7aff025
JCL      - c31cbd715b based on jdk-17.0.7+5)

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

Optional info

Failure output (captured from console output)

[2023-04-08T17:01:58.041Z] variation: Mode150
[2023-04-08T17:01:58.041Z] JVM_OPTIONS:  -XX:+UseCompressedOops 

[2023-04-08T17:40:55.779Z] TEST: sun/security/pkcs11/Provider/Login.java

[2023-04-08T17:40:55.780Z] STDOUT:
[2023-04-08T17:40:55.780Z] config Login.setUp(): success
[2023-04-08T17:40:55.780Z] Beginning test run Login...
[2023-04-08T17:40:55.780Z] nssLibDir: /usr/lib64/
[2023-04-08T17:40:55.780Z] test Login.testLogin(): failure
[2023-04-08T17:40:55.780Z] java.security.ProviderException: Initialization failed
[2023-04-08T17:40:55.780Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:465)
[2023-04-08T17:40:55.780Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:144)
[2023-04-08T17:40:55.780Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:141)
[2023-04-08T17:40:55.780Z] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:748)
[2023-04-08T17:40:55.780Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.configure(SunPKCS11.java:141)
[2023-04-08T17:40:55.780Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:150)
[2023-04-08T17:40:55.780Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:142)
[2023-04-08T17:40:55.780Z] 	at PKCS11Test.testNSS(PKCS11Test.java:549)
[2023-04-08T17:40:55.780Z] 	at PKCS11Test.main(PKCS11Test.java:210)
[2023-04-08T17:40:55.780Z] 	at Login.testLogin(Login.java:58)
[2023-04-08T17:40:55.780Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2023-04-08T17:40:55.780Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[2023-04-08T17:40:55.780Z] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2023-04-08T17:40:55.780Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[2023-04-08T17:40:55.780Z] 	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
[2023-04-08T17:40:55.780Z] 	at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:599)
[2023-04-08T17:40:55.780Z] 	at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174)
[2023-04-08T17:40:55.780Z] 	at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
[2023-04-08T17:40:55.780Z] 	at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822)
[2023-04-08T17:40:55.780Z] 	at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147)
[2023-04-08T17:40:55.780Z] 	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
[2023-04-08T17:40:55.780Z] 	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
[2023-04-08T17:40:55.780Z] 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
[2023-04-08T17:40:55.780Z] 	at org.testng.TestRunner.privateRun(TestRunner.java:764)
[2023-04-08T17:40:55.780Z] 	at org.testng.TestRunner.run(TestRunner.java:585)
[2023-04-08T17:40:55.780Z] 	at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
[2023-04-08T17:40:55.780Z] 	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378)
[2023-04-08T17:40:55.780Z] 	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337)
[2023-04-08T17:40:55.780Z] 	at org.testng.SuiteRunner.run(SuiteRunner.java:286)
[2023-04-08T17:40:55.780Z] 	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
[2023-04-08T17:40:55.780Z] 	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
[2023-04-08T17:40:55.780Z] 	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1218)
[2023-04-08T17:40:55.780Z] 	at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
[2023-04-08T17:40:55.780Z] 	at org.testng.TestNG.runSuites(TestNG.java:1069)
[2023-04-08T17:40:55.780Z] 	at org.testng.TestNG.run(TestNG.java:1037)
[2023-04-08T17:40:55.780Z] 	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
[2023-04-08T17:40:55.780Z] 	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54)
[2023-04-08T17:40:55.780Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2023-04-08T17:40:55.780Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[2023-04-08T17:40:55.780Z] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2023-04-08T17:40:55.780Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[2023-04-08T17:40:55.780Z] 	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
[2023-04-08T17:40:55.780Z] 	at java.base/java.lang.Thread.run(Thread.java:857)
[2023-04-08T17:40:55.780Z] Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: 0xCE534351(CKR_NSS_CERTDB_FAILED)
[2023-04-08T17:40:55.780Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.wrapper.PKCS11.C_Initialize(Native Method)
[2023-04-08T17:40:55.780Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.wrapper.PKCS11$SynchronizedPKCS11.C_Initialize(PKCS11.java:1678)
[2023-04-08T17:40:55.780Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.wrapper.PKCS11.getInstance(PKCS11.java:213)
[2023-04-08T17:40:55.780Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:368)
[2023-04-08T17:40:55.780Z] 	... 42 more
[2023-04-08T17:40:55.780Z] 
[2023-04-08T17:40:55.780Z] ===============================================
[2023-04-08T17:40:55.780Z] sun/security/pkcs11/Provider/Login.java
[2023-04-08T17:40:55.780Z] Total tests run: 1, Passes: 0, Failures: 1, Skips: 0

[2023-04-08T17:41:02.701Z] TEST: sun/security/pkcs11/Secmod/AddPrivateKey.java

[2023-04-08T17:41:02.702Z] STDERR:
[2023-04-08T17:41:02.702Z] java.security.ProviderException: Could not initialize NSS
[2023-04-08T17:41:02.702Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:250)
[2023-04-08T17:41:02.702Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:144)
[2023-04-08T17:41:02.702Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:141)
[2023-04-08T17:41:02.702Z] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:748)
[2023-04-08T17:41:02.702Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.configure(SunPKCS11.java:141)
[2023-04-08T17:41:02.702Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:150)
[2023-04-08T17:41:02.702Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:142)
[2023-04-08T17:41:02.702Z] 	at AddPrivateKey.main(AddPrivateKey.java:76)
[2023-04-08T17:41:02.702Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2023-04-08T17:41:02.702Z] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[2023-04-08T17:41:02.702Z] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2023-04-08T17:41:02.702Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[2023-04-08T17:41:02.702Z] 	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
[2023-04-08T17:41:02.702Z] 	at java.base/java.lang.Thread.run(Thread.java:857)
[2023-04-08T17:41:02.702Z] Caused by: java.io.IOException: NSS initialization failed
[2023-04-08T17:41:02.702Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.Secmod.initialize(Secmod.java:243)
[2023-04-08T17:41:02.702Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:245)
[2023-04-08T17:41:02.702Z] 	... 13 more
[2023-04-08T17:41:02.702Z] 
[2023-04-08T17:41:02.702Z] JavaTest Message: Test threw exception: java.security.ProviderException: Could not initialize NSS

[2023-04-08T18:56:30.730Z] Test results: passed: 823; failed: 6; error: 1
[2023-04-08T18:56:32.333Z] Report written to /home/jenkins/workspace/Test_openjdk17_j9_extended.openjdk_ppc64le_linux/aqa-tests/TKG/output_1680967014141/jdk_security3_0/report/html/report.html
[2023-04-08T18:56:32.333Z] Results written to /home/jenkins/workspace/Test_openjdk17_j9_extended.openjdk_ppc64le_linux/aqa-tests/TKG/output_1680967014141/jdk_security3_0/work
[2023-04-08T18:56:32.333Z] Error: Some tests failed or other problems occurred.
[2023-04-08T18:56:32.333Z] -----------------------------------
[2023-04-08T18:56:32.333Z] jdk_security3_0_FAILED

50x internal grinder - passed in 3 machines, failed at rhel9lert-1, another infra error

@pshipton
Copy link
Member

This seems like a machine problem.
@jasonkatonica fyi

@taoliult
Copy link
Contributor

@JasonFengJ9

Does the tests failed in FIPS mode or not?

If the failures are not in FIPS mode, then maybe an environment issue, rerun the tests to see if the issues are still there.

If they failed in FIPS mode, from above, there are two failed test cases:

TEST: sun/security/pkcs11/Provider/Login.java

[2023-04-08T17:40:55.780Z] test Login.testLogin(): failure
[2023-04-08T17:40:55.780Z] java.security.ProviderException: Initialization failed
[2023-04-08T17:40:55.780Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:465)
[2023-04-08T17:40:55.780Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:144)
[2023-04-08T17:40:55.780Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:141)
[2023-04-08T17:40:55.780Z] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:748)
[2023-04-08T17:40:55.780Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.configure(SunPKCS11.java:141)
[2023-04-08T17:40:55.780Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:150)
[2023-04-08T17:40:55.780Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:142)
[2023-04-08T17:40:55.780Z] 	at PKCS11Test.testNSS(PKCS11Test.java:549)
[2023-04-08T17:40:55.780Z] 	at PKCS11Test.main(PKCS11Test.java:210)
[2023-04-08T17:40:55.780Z] 	at Login.testLogin(Login.java:58)

TEST: sun/security/pkcs11/Secmod/AddPrivateKey.java

[2023-04-08T17:41:02.702Z] java.security.ProviderException: Could not initialize NSS
[2023-04-08T17:41:02.702Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:250)
[2023-04-08T17:41:02.702Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:144)
[2023-04-08T17:41:02.702Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:141)
[2023-04-08T17:41:02.702Z] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:748)
[2023-04-08T17:41:02.702Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.configure(SunPKCS11.java:141)
[2023-04-08T17:41:02.702Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:150)
[2023-04-08T17:41:02.702Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:142)
[2023-04-08T17:41:02.702Z] 	at AddPrivateKey.main(AddPrivateKey.java:76)

And both of them start fail at

[2023-04-08T17:41:02.702Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:150)
[2023-04-08T17:41:02.702Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:142)

From the PKCS11Test.java around line 142 and 150, codes below:

    // Return the static test SunPKCS11 provider configured with the specified config file
    static Provider getSunPKCS11(String config) throws Exception {
        return getSunPKCS11(config, pkcs11);
    }

    // Return the Provider p configured with the specified config file
    static Provider getSunPKCS11(String config, Provider p) throws Exception {
        if (p == null) {
            throw new NoSuchProviderException("No PKCS11 provider available");
        }
        return p.configure(config);
    }

They are trying to initialize the SunPKCS11 provider using the specified config file. Take test "AddPrivateKey.java" as example, at line "AddPrivateKey.main(AddPrivateKey.java:76)", codes below:

        String configName = BASE + SEP + "nss.cfg";
        Provider p = getSunPKCS11(configName);

It is trying to use the config file " BASE + SEP + "nss.cfg"" which is a file in the test folder, to initialize the SunPKCS11 in the NSS security mode.

    // directory of the test source
    static final String BASE = System.getProperty("test.src", ".");
    static final char SEP = File.separatorChar;

But, the SunPKCS11 can only be initialized once, and in our case, the SunPKCS11 is already initialized in NSS as FIPS mode, so it can not be initialize again by other NSS config files.

@JasonFengJ9
Copy link
Member Author

JasonFengJ9 commented Apr 12, 2023

@taoliult pls see my comments below

Does the tests failed in FIPS mode or not?

The failed JVM is JDK17 ppc64le_linux, does it support FIPS mode? java.security specifies linux-x86 only for Java Restricted Security Mode which I assume is required by FIPS.

#ifdef linux-x86
#
# Java Restricted Security Mode

If the failures are not in FIPS mode, then maybe an environment issue, rerun the tests to see if the issues are still there.

50x internal grinder passed in 3 machines, failed at rhel9lert-1, with another infra error.
Launched another grinder at the same machine 10x grinder at rhel9lert-1 - all failed
Edit: this smells a machine issue, what's the difference though?

But, the SunPKCS11 can only be initialized once, and in our case, the SunPKCS11 is already initialized in NSS as FIPS mode, so it can not be initialize again by other NSS config files.

Since this is non-FIPS mode run, can the SunPKCS11 still be initialized by others first, or is there another cause for the initialization failure besides multiple attempts?

@taoliult
Copy link
Contributor

taoliult commented May 3, 2023

@JasonFengJ9 Sorry for replying late.

Right now, Semeru FIPS only support the Redhat linux x86 platform, it doesn't support the ppc64le.

You mentioned, launched another grinder at the same machine and all failed. Does this machine infrastructure/OS is same as the other 3 machines which you mentioned passed?

As I remember when I look at the SunPKCS11 provider, before initializing the nss secmod, it will check if the nss secmod is already initialized or not, if it already initialized, then it won't be initialized again. But in your failed case rhel9lert-1, I see it failed at:

02:37:21 Caused by: java.io.IOException: NSS initialization failed
02:37:21 at jdk.crypto.cryptoki/sun.security.pkcs11.Secmod.initialize(Secmod.java:243)
02:37:21 at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.(SunPKCS11.java:245)
02:37:21 ... 13 more

It failed after check the "already initialized", which return false. That mean, the nss secmod is not initialized yet. So, next, it will try to initialize the nss secmod, but failed when initializing. So, the failures is not due to initialize twice.

So, does the failed machine same as the other 3 passed machines? If there are same, then it should be a kind of machine issue. If there are not same, maybe, you can first try to run the same tests using another machine same as the failed one, to check if it is due to the machine issue or not.

@JasonFengJ9
Copy link
Member Author

JDK20 s390x_linux failed at a different machine rhel9s390x-svl-rt2-1.

[2023-06-09T23:51:13.185Z] variation: Mode650
[2023-06-09T23:51:13.185Z] JVM_OPTIONS:  -XX:-UseCompressedOops 

[2023-06-10T00:27:01.446Z] TEST: sun/security/pkcs11/Secmod/AddPrivateKey.java

[2023-06-10T00:27:01.447Z] STDOUT:
[2023-06-10T00:27:01.447Z] nssLibDir: /usr/lib64/
[2023-06-10T00:27:01.447Z] STDERR:
[2023-06-10T00:27:01.447Z] java.security.ProviderException: Could not initialize NSS
[2023-06-10T00:27:01.447Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:255)
[2023-06-10T00:27:01.447Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:152)
[2023-06-10T00:27:01.447Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:149)
[2023-06-10T00:27:01.447Z] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:748)
[2023-06-10T00:27:01.447Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.configure(SunPKCS11.java:149)
[2023-06-10T00:27:01.447Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:150)
[2023-06-10T00:27:01.447Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:142)
[2023-06-10T00:27:01.447Z] 	at AddPrivateKey.main(AddPrivateKey.java:76)
[2023-06-10T00:27:01.447Z] 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
[2023-06-10T00:27:01.447Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
[2023-06-10T00:27:01.447Z] 	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125)
[2023-06-10T00:27:01.447Z] 	at java.base/java.lang.Thread.run(Thread.java:1639)
[2023-06-10T00:27:01.447Z] Caused by: java.io.IOException: NSS initialization failed
[2023-06-10T00:27:01.447Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.Secmod.initialize(Secmod.java:243)
[2023-06-10T00:27:01.447Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:250)
[2023-06-10T00:27:01.447Z] 	... 11 more
[2023-06-10T00:27:01.447Z] 
[2023-06-10T00:27:01.447Z] JavaTest Message: Test threw exception: java.security.ProviderException: Could not initialize NSS

[2023-06-10T01:12:56.636Z] jdk_security3_1_FAILED

30x grinder

@pshipton
Copy link
Member

Guessing this is a machine setup issue.
@AdamBrousseau fyi

@JasonFengJ9
Copy link
Member Author

JDK11 x86-64_linux rc1(rhel9x86-rt1-1)

[2023-07-19T20:44:59.443Z] TEST: sun/security/pkcs11/Secmod/AddPrivateKey.java

[2023-07-19T20:44:59.470Z] STDERR:
[2023-07-19T20:44:59.470Z] java.security.ProviderException: Could not initialize NSS
[2023-07-19T20:44:59.470Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:254)
[2023-07-19T20:44:59.470Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:148)
[2023-07-19T20:44:59.470Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:145)
[2023-07-19T20:44:59.470Z] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:746)
[2023-07-19T20:44:59.470Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.configure(SunPKCS11.java:145)
[2023-07-19T20:44:59.470Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:200)
[2023-07-19T20:44:59.470Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:192)
[2023-07-19T20:44:59.470Z] 	at AddPrivateKey.main(AddPrivateKey.java:76)
[2023-07-19T20:44:59.471Z] Caused by: java.io.IOException: NSS initialization failed
[2023-07-19T20:44:59.471Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.Secmod.initialize(Secmod.java:243)
[2023-07-19T20:44:59.471Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:249)
[2023-07-19T20:44:59.471Z] 	... 13 more
[2023-07-19T20:44:59.471Z] 
[2023-07-19T20:44:59.471Z] JavaTest Message: Test threw exception: java.security.ProviderException: Could not initialize NSS

@JasonFengJ9
Copy link
Member Author

JasonFengJ9 commented Dec 14, 2023

JDK17 x86-64_linux(cent9x86-svl-rt2-1)

23:48:39  openjdk version "17.0.10" 2024-01-16
23:48:39  IBM Semeru Runtime Open Edition 17.0.10.0-m2 (build 17.0.10+6)
23:48:39  Eclipse OpenJ9 VM 17.0.10.0-m2 (build v0.43.0-release-628037b26, JRE 17 Linux amd64-64-Bit Compressed References 20240116_631 (JIT enabled, AOT enabled)
23:48:39  OpenJ9   - 628037b26
23:48:39  OMR      - d810fcb98
23:48:39  JCL      - 6b8a7528cc1 based on jdk-17.0.10+6)

00:33:17  TEST: sun/security/pkcs11/Secmod/TrustAnchors.java

00:33:17  STDERR:
00:33:17  java.security.ProviderException: Could not initialize NSS
00:33:17  	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:257)
00:33:17  	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:151)
00:33:17  	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:148)
00:33:17  	at java.base/java.security.AccessController.doPrivileged(AccessController.java:748)
00:33:17  	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.configure(SunPKCS11.java:148)
00:33:17  	at PKCS11Test.getSunPKCS11(PKCS11Test.java:150)
00:33:17  	at PKCS11Test.getSunPKCS11(PKCS11Test.java:142)
00:33:17  	at TrustAnchors.main(TrustAnchors.java:61)
00:33:17  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
00:33:17  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
00:33:17  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
00:33:17  	at java.base/java.lang.reflect.Method.invoke(Method.java:574)
00:33:17  	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
00:33:17  	at java.base/java.lang.Thread.run(Thread.java:857)
00:33:17  Caused by: java.io.IOException: NSS initialization failed
00:33:17  	at jdk.crypto.cryptoki/sun.security.pkcs11.Secmod.initialize(Secmod.java:243)
00:33:17  	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:252)
00:33:17  	... 13 more
00:33:17  
00:33:17  JavaTest Message: Test threw exception: java.security.ProviderException: Could not initialize NSS

00:33:17  TEST RESULT: Failed. Execution failed: `main' threw exception: java.security.ProviderException: Could not initialize NSS
00:33:17  --------------------------------------------------
01:23:10  Test results: passed: 834; failed: 7; error: 1
01:23:22  Report written to /home/jenkins/workspace/Test_openjdk17_j9_extended.openjdk_x86-64_linux_testList_3/aqa-tests/TKG/output_17025293747823/jdk_security3_1/report/html/report.html
01:23:22  Results written to /home/jenkins/workspace/Test_openjdk17_j9_extended.openjdk_x86-64_linux_testList_3/aqa-tests/TKG/output_17025293747823/jdk_security3_1/work
01:23:22  Error: Some tests failed or other problems occurred.
01:23:22  -----------------------------------
01:23:22  jdk_security3_1_FAILED

@JasonFengJ9
Copy link
Member Author

JasonFengJ9 commented Jan 5, 2024

JDK21 s390x_linux(rhel9s390x-svl-rt4-1)

openjdk version "21.0.1" 2023-10-17 LTS
IBM Semeru Runtime Open Edition 21.0.1.0-m3 (build 21.0.1+12-LTS)
Eclipse OpenJ9 VM 21.0.1.0-m3 (build v0.42.0-release-69b6ceb69, JRE 21 Linux s390x-64-Bit Compressed References 20231017_74 (JIT enabled, AOT enabled)
OpenJ9   - 69b6ceb69
OMR      - 494d6eb66
JCL      - 5846adac994 based on jdk-21.0.1+12)

[2024-01-05T07:22:13.657Z] variation: Mode150
[2024-01-05T07:22:13.657Z] JVM_OPTIONS:  -XX:+UseCompressedOops -Xverbosegclog 

[2024-01-05T07:51:18.721Z] STDERR:
[2024-01-05T07:51:18.721Z] java.security.ProviderException: Could not initialize NSS
[2024-01-05T07:51:18.721Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:262)
[2024-01-05T07:51:18.721Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:159)
[2024-01-05T07:51:18.721Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:156)
[2024-01-05T07:51:18.721Z] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:748)
[2024-01-05T07:51:18.721Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.configure(SunPKCS11.java:156)
[2024-01-05T07:51:18.721Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:154)
[2024-01-05T07:51:18.721Z] 	at PKCS11Test.getSunPKCS11(PKCS11Test.java:146)
[2024-01-05T07:51:18.721Z] 	at TrustAnchors.main(TrustAnchors.java:61)
[2024-01-05T07:51:18.721Z] 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[2024-01-05T07:51:18.721Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:586)
[2024-01-05T07:51:18.721Z] 	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
[2024-01-05T07:51:18.721Z] 	at java.base/java.lang.Thread.run(Thread.java:1595)
[2024-01-05T07:51:18.721Z] Caused by: java.io.IOException: NSS initialization failed
[2024-01-05T07:51:18.721Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.Secmod.initialize(Secmod.java:243)
[2024-01-05T07:51:18.721Z] 	at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:257)
[2024-01-05T07:51:18.721Z] 	... 11 more
[2024-01-05T07:51:18.721Z] 
[2024-01-05T07:51:18.721Z] JavaTest Message: Test threw exception: java.security.ProviderException: Could not initialize NSS

[2024-01-05T08:41:04.878Z] Test results: passed: 898; failed: 7; error: 1
[2024-01-05T08:41:37.257Z] Report written to /home/jenkins/workspace/Test_openjdk21_j9_extended.openjdk_s390x_linux/aqa-tests/TKG/output_17044343482978/jdk_security3_0/report/html/report.html
[2024-01-05T08:41:37.257Z] Results written to /home/jenkins/workspace/Test_openjdk21_j9_extended.openjdk_s390x_linux/aqa-tests/TKG/output_17044343482978/jdk_security3_0/work
[2024-01-05T08:41:37.257Z] Error: Some tests failed or other problems occurred.
[2024-01-05T08:41:37.772Z] -----------------------------------
[2024-01-05T08:41:37.772Z] jdk_security3_0_FAILED

50x grinder - passed in 6 machines, failed in the other 4 machines.

@pshipton
Copy link
Member

pshipton commented Jan 5, 2024

I'd bet this is a machine setup issue.

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

3 participants