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_security1_0 FAILED java/security/Security/ConfigFileTest.java RuntimeException: OpenJCEPlusFIPS is not present in the java.security file. #20788

Open
JasonFengJ9 opened this issue Dec 9, 2024 · 2 comments

Comments

@JasonFengJ9
Copy link
Member

JasonFengJ9 commented Dec 9, 2024

Failure link

From internal Test_openjdk21_j9_sanity.openjdk_x86-64_linux_fips140_3_openjceplusfips (rtj-rhel9x86-rtp-test-3lkaa-1)

java version "21.0.6-beta" 2025-01-21
IBM Semeru Runtime Certified Edition 21.0.6+6-202412071603 (build 21.0.6-beta+6-202412071603)
Eclipse OpenJ9 VM 21.0.6+6-202412071603 (build master-501751012f, JRE 21 Linux amd64-64-Bit Compressed References 20241207_325 (JIT enabled, AOT enabled)
OpenJ9   - 501751012f
OMR      - b893b2be2
JCL      - 71fff4eae based on jdk-21.0.6+6)

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

Optional info

Failure output (captured from console output)

[2024-12-07T16:53:27.767Z] variation: Mode150
[2024-12-07T16:53:27.767Z] JVM_OPTIONS:  -XX:+UseCompressedOops -Xverbosegclog  -Dsemeru.fips=true -Dsemeru.customprofile=OpenJCEPlusFIPS

[2024-12-07T16:56:53.945Z] TEST: java/security/Security/ConfigFileTest.java

[2024-12-07T16:56:53.949Z]  stderr: [properties: java.security
[2024-12-07T16:56:53.949Z] properties: overriding other security properties files!
[2024-12-07T16:56:53.949Z] properties: java.security
[2024-12-07T16:56:53.949Z] properties: Initial security property: security.provider.1=sun.security.provider.Sun
[2024-12-07T16:56:53.949Z] properties: Initial security property: security.provider.2=SunRsaSign
[2024-12-07T16:56:53.949Z] properties: Initial security property: security.provider.3=sun.security.ssl.SunJSSE
[2024-12-07T16:56:53.949Z] properties: Initial security property: security.provider.4=com.sun.crypto.provider.SunJCE
[2024-12-07T16:56:53.949Z] properties: Initial security property: security.provider.5=SunJGSS
[2024-12-07T16:56:53.949Z] properties: Initial security property: security.provider.6=SunSASL
[2024-12-07T16:56:53.949Z] semerufips: Restricted security mode is being enabled...
[2024-12-07T16:56:53.949Z] semerufips: Profile specified without version (i.e., <profile>): OpenJCEPlusFIPS
[2024-12-07T16:56:53.949Z] java.lang.RuntimeException: OpenJCEPlusFIPS is not present in the java.security file.
[2024-12-07T16:56:53.949Z] 	at java.base/openj9.internal.security.RestrictedSecurity.printStackTraceAndExit(RestrictedSecurity.java:663)
[2024-12-07T16:56:53.949Z] 	at java.base/openj9.internal.security.RestrictedSecurity.getProfileID(RestrictedSecurity.java:369)
[2024-12-07T16:56:53.949Z] 	at java.base/openj9.internal.security.RestrictedSecurity.configure(RestrictedSecurity.java:476)
[2024-12-07T16:56:53.949Z] 	at java.base/java.security.Security.initialize(Security.java:146)
[2024-12-07T16:56:53.949Z] 	at java.base/java.security.Security.lambda$static$0(Security.java:96)
[2024-12-07T16:56:53.949Z] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:695)
[2024-12-07T16:56:53.949Z] 	at java.base/java.security.Security.<clinit>(Security.java:95)
[2024-12-07T16:56:53.949Z] 	at java.base/sun.security.util.SecurityProperties.getOverridableProperty(SecurityProperties.java:57)
[2024-12-07T16:56:53.949Z] 	at java.base/sun.security.util.SecurityProperties.privilegedGetOverridable(SecurityProperties.java:48)
[2024-12-07T16:56:53.949Z] 	at java.base/sun.security.util.SecurityProperties.includedInExceptions(SecurityProperties.java:72)
[2024-12-07T16:56:53.949Z] 	at java.base/sun.security.util.SecurityProperties.<clinit>(SecurityProperties.java:36)
[2024-12-07T16:56:53.949Z] 	at java.base/sun.security.util.FilePermCompat.<clinit>(FilePermCompat.java:43)
[2024-12-07T16:56:53.949Z] 	at java.base/java.io.FilePermission.init(FilePermission.java:319)
[2024-12-07T16:56:53.949Z] 	at java.base/java.io.FilePermission.<init>(FilePermission.java:490)
[2024-12-07T16:56:53.949Z] 	at java.base/sun.net.www.protocol.file.FileURLConnection.getPermission(FileURLConnection.java:217)
[2024-12-07T16:56:53.949Z] 	at java.base/sun.security.util.LazyCodeSourcePermissionCollection.ensureAdded(LazyCodeSourcePermissionCollection.java:69)
[2024-12-07T16:56:53.949Z] 	at java.base/sun.security.util.LazyCodeSourcePermissionCollection.toString(LazyCodeSourcePermissionCollection.java:115)
[2024-12-07T16:56:53.949Z] 	at java.base/java.lang.String.valueOf(String.java:5237)
[2024-12-07T16:56:53.949Z] 	at java.base/java.lang.StringBuilder.append(StringBuilder.java:173)
[2024-12-07T16:56:53.949Z] 	at java.base/java.security.ProtectionDomain.toString(ProtectionDomain.java:434)
[2024-12-07T16:56:53.949Z] 	at java.base/java.lang.String.valueOf(String.java:5237)
[2024-12-07T16:56:53.949Z] 	at java.base/java.lang.StringBuilder.append(StringBuilder.java:173)
[2024-12-07T16:56:53.949Z] 	at java.base/java.security.SecureClassLoader$1.apply(SecureClassLoader.java:231)
[2024-12-07T16:56:53.949Z] 	at java.base/java.security.SecureClassLoader$1.apply(SecureClassLoader.java:222)
[2024-12-07T16:56:53.949Z] 	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1716)
[2024-12-07T16:56:53.949Z] 	at java.base/java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:222)
[2024-12-07T16:56:53.949Z] 	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
[2024-12-07T16:56:53.949Z] 	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:1174)
[2024-12-07T16:56:53.949Z] 	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:961)
[2024-12-07T16:56:53.949Z] 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:867)
[2024-12-07T16:56:53.949Z] 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:825)
[2024-12-07T16:56:53.949Z] 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
[2024-12-07T16:56:53.949Z] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1103)
[2024-12-07T16:56:53.949Z] 	at java.base/java.lang.Class.forNameImpl(Native Method)
[2024-12-07T16:56:53.949Z] 	at java.base/java.lang.Class.forNameHelper(Class.java:452)
[2024-12-07T16:56:53.949Z] 	at java.base/java.lang.Class.forName(Class.java:430)
[2024-12-07T16:56:53.949Z] 	at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:811)
[2024-12-07T16:56:53.949Z] 	at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:706)
[2024-12-07T16:56:53.949Z] ]
[2024-12-07T16:56:53.949Z]  exitValue = 1
[2024-12-07T16:56:53.949Z] 
[2024-12-07T16:56:53.949Z] java.lang.RuntimeException: Expected to get exit value of [0], exit value is: [1]
[2024-12-07T16:56:53.949Z] 	at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:500)
[2024-12-07T16:56:53.949Z] 	at ConfigFileTest.exerciseSecurity(ConfigFileTest.java:137)
[2024-12-07T16:56:53.949Z] 	at ConfigFileTest.main(ConfigFileTest.java:99)
[2024-12-07T16:56:53.949Z] 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[2024-12-07T16:56:53.949Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:586)
[2024-12-07T16:56:53.949Z] 	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
[2024-12-07T16:56:53.949Z] 	at java.base/java.lang.Thread.run(Thread.java:1595)
[2024-12-07T16:56:53.949Z] 
[2024-12-07T16:56:53.949Z] JavaTest Message: Test threw exception: java.lang.RuntimeException
[2024-12-07T16:56:53.949Z] JavaTest Message: shutting down test
[2024-12-07T16:56:53.949Z] 
[2024-12-07T16:56:53.949Z] 
[2024-12-07T16:56:53.949Z] TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Expected to get exit value of [0], exit value is: [1]
[2024-12-07T16:56:53.949Z] --------------------------------------------------
[2024-12-07T16:56:55.849Z] Test results: passed: 118; failed: 1
[2024-12-07T16:57:19.556Z] Report written to /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_x86-64_linux_fips140_3_openjceplusfips/aqa-tests/TKG/output_17335904065439/jdk_security1_0/report/html/report.html
[2024-12-07T16:57:19.556Z] Results written to /home/jenkins/workspace/Test_openjdk21_j9_sanity.openjdk_x86-64_linux_fips140_3_openjceplusfips/aqa-tests/TKG/output_17335904065439/jdk_security1_0/work
[2024-12-07T16:57:19.556Z] Error: Some tests failed or other problems occurred.
[2024-12-07T16:57:19.556Z] -----------------------------------
[2024-12-07T16:57:19.556Z] jdk_security1_0_FAILED

5x internal Grinder - all failed

FYI @jasonkatonica

Copy link

github-actions bot commented Dec 9, 2024

Issue Number: 20788
Status: Open
Recommended Components: comp:jclextensions, comp:test, comp:infra

@KostasTsiounis
Copy link
Contributor

This test is using random java.security files in the test on this line, most likely they do not contain a profile.

The test was recently updated. In the past, the flags passed weren't utilized, but that changed with this commit. After that, the FIPS flag are honoured and RestrictedSecurity tries to find an OpenJCEPlusFIPS profile and fails.

This test should probably be excluded, as trying different java.security files that don't contain the FIPS profiles is not applicable.

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