TestLinker.java Test Failure

Saint Wesonga Saint.Wesonga at microsoft.com
Wed Jan 3 18:21:38 UTC 2024


Hello,

I'm seeing a jtreg test failure in java/foreign/TestLinker.java<https://github.com/openjdk/jdk/blob/master/test/jdk/java/foreign/TestLinker.java> (tested on Windows x64 & aarch64, Linux x64):

test TestLinker.testLinkerOptionsCache(): failure
java.util.ServiceConfigurationError: Locale provider adapter "CLDR"cannot be instantiated.
        at java.base/sun.util.locale.provider.LocaleProviderAdapter.forType(LocaleProviderAdapter.java:197)
        at java.base/sun.util.locale.provider.LocaleProviderAdapter.findAdapter(LocaleProviderAdapter.java:285)
        at java.base/sun.util.locale.provider.LocaleProviderAdapter.getAdapter(LocaleProviderAdapter.java:256)
        at java.base/java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:181)
...
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.util.locale.provider")
        at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:488)
        at java.base/java.security.AccessController.checkPermission(AccessController.java:1085)
        at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:411)
        at java.base/java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1318)
...
STDERR:
WARNING: A command line option has enabled the Security Manager
WARNING: The Security Manager is deprecated and will be removed in a future release
WARNING: A restricted method in java.lang.foreign.AddressLayout has been called
WARNING: java.lang.foreign.AddressLayout::withTargetLayout has been called by NativeTestHelper in an unnamed module
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

The test passes if the security policy is removed:

--- a/test/jdk/java/foreign/TestLinker.java
+++ b/test/jdk/java/foreign/TestLinker.java
@@ -25,8 +25,7 @@
  * @test
  * @modules java.base/jdk.internal.foreign
  * @run testng TestLinker
- * @run testng/othervm/policy=security.policy
- *          -Djava.security.manager=default TestLinker
+ * @run testng/othervm TestLinker
  */

Since the security manager is deprecated, does the test need to be updated to remove this security policy option, or is there a different aspect of security that needs to be tested?

Thanks,
-Saint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20240103/67fd8ce7/attachment.htm>


More information about the panama-dev mailing list