Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8315891

java/foreign/TestLinker.java failed with "error occurred while instantiating class TestLinker: null"

    XMLWordPrintable

Details

    • b15
    • x86_64
    • linux
    • Verified

    Backports

      Description

        The following test failed in the JDK22 CI:

        java/foreign/TestLinker.java

        Here's a snippet from the log file:

        #section:testng
        ----------messages:(7/433)----------
        command: testng -Djava.security.manager=default TestLinker
        reason: User specified action: run testng/othervm/policy=security.policy -Djava.security.manager=default TestLinker
        started: Thu Sep 07 22:56:19 UTC 2023
        Mode: othervm [/othervm specified]
        Additional options from @modules: --add-modules java.base --add-exports java.base/jdk.internal.foreign=ALL-UNNAMED
        finished: Thu Sep 07 22:56:20 UTC 2023
        elapsed time (seconds): 0.841
        ----------configuration:(4/117)----------
        Boot Layer
          add modules: java.base
          add exports: java.base/jdk.internal.foreign ALL-UNNAMED

        ----------System.out:(2/128)----------
        NativeTestHelper::DEFAULT_RANDOM.seed = -716860814
        Re-run with '-DNativeTestHelper.DEFAULT_RANDOM.seed=-716860814' to reproduce
        ----------System.err:(70/4914)----------
        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 the unnamed module
        WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for this module

        org.testng.TestNGException:
        An error occurred while instantiating class TestLinker: null
        at org.testng.internal.InstanceCreator.createInstanceUsingObjectFactory(InstanceCreator.java:123)
        at org.testng.internal.InstanceCreator.createInstance(InstanceCreator.java:79)
        at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:109)
        at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:167)
        at org.testng.TestClass.getInstances(TestClass.java:102)
        at org.testng.TestClass.initTestClassesAndInstances(TestClass.java:82)
        at org.testng.TestClass.init(TestClass.java:74)
        at org.testng.TestClass.<init>(TestClass.java:39)
        at org.testng.TestRunner.initMethods(TestRunner.java:457)
        at org.testng.TestRunner.init(TestRunner.java:336)
        at org.testng.TestRunner.init(TestRunner.java:289)
        at org.testng.TestRunner.<init>(TestRunner.java:180)
        at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:613)
        at org.testng.SuiteRunner.init(SuiteRunner.java:178)
        at org.testng.SuiteRunner.<init>(SuiteRunner.java:112)
        at org.testng.TestNG.createSuiteRunner(TestNG.java:1306)
        at org.testng.TestNG.createSuiteRunners(TestNG.java:1282)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:1131)
        at org.testng.TestNG.runSuites(TestNG.java:1069)
        at org.testng.TestNG.run(TestNG.java:1037)
        at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:102)
        at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:58)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
        at java.base/java.lang.Thread.run(Thread.java:1570)
        Caused by: java.lang.ExceptionInInitializerError
        at java.base/jdk.internal.foreign.abi.fallback.FallbackLinker.isSupported(FallbackLinker.java:78)
        at java.base/jdk.internal.foreign.CABI.computeCurrent(CABI.java:95)
        at java.base/jdk.internal.foreign.CABI.<clinit>(CABI.java:49)
        at java.base/jdk.internal.foreign.abi.SharedUtils$4.<clinit>(SharedUtils.java:239)
        at java.base/jdk.internal.foreign.abi.SharedUtils.getSystemLinker(SharedUtils.java:239)
        at java.base/java.lang.foreign.Linker.nativeLinker(Linker.java:502)
        at NativeTestHelper.<clinit>(NativeTestHelper.java:126)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
        at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.ensureClassInitialized(MethodHandleAccessorFactory.java:300)
        at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.newConstructorAccessor(MethodHandleAccessorFactory.java:103)
        at java.base/jdk.internal.reflect.ReflectionFactory.newConstructorAccessor(ReflectionFactory.java:173)
        at java.base/java.lang.reflect.Constructor.acquireConstructorAccessor(Constructor.java:549)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
        at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:23)
        at org.testng.internal.InstanceCreator.instantiateUsingDefaultConstructor(InstanceCreator.java:193)
        at org.testng.internal.InstanceCreator.createInstanceUsingObjectFactory(InstanceCreator.java:113)
        ... 25 more
        Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "loadLibrary.fallbackLinker")
        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.checkLink(SecurityManager.java:689)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:910)
        at java.base/java.lang.System.loadLibrary(System.java:2063)
        at java.base/jdk.internal.foreign.abi.fallback.LibFallback.tryLoadLibrary(LibFallback.java:41)
        at java.base/jdk.internal.foreign.abi.fallback.LibFallback.<clinit>(LibFallback.java:37)
        ... 43 more

        JavaTest Message: Test threw exception: org.testng.TestNGException:
        An error occurred while instantiating class TestLinker: null
        JavaTest Message: shutting down test

        STATUS:Failed.`main' threw exception: org.testng.TestNGException: An error occurred while instantiating class TestLinker: null
        ----------rerun:(44/6697)*----------

        Attachments

          Issue Links

            Activity

              People

                mcimadamore Maurizio Cimadamore
                dcubed Daniel Daugherty
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: