eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.27k stars 721 forks source link

JDK16 java/foreign/TestNative.java - UnsatisfiedLinkError: jdk/internal/foreign/abi/ProgrammableInvoker.registerNatives()V #11760

Open JasonFengJ9 opened 3 years ago

JasonFengJ9 commented 3 years ago

Failure link

From an internal build openjdk16-pipeline #3/jdk16-linux-x64-openj9 #1/Test_openjdk16_j9_sanity.openjdk_x86-64_linux #1/jdk_foreign_native_0:

10:09:36  openjdk version "16" 2021-03-16
10:09:36  OpenJDK Runtime Environment AdoptOpenJDK (build 16+32-202101220448)
10:09:36  Eclipse OpenJ9 VM AdoptOpenJDK (build master-a1cfdc286, JRE 16 Linux amd64-64-Bit Compressed References 20210122_1 (JIT enabled, AOT enabled)
10:09:36  OpenJ9   - a1cfdc286
10:09:36  OMR      - cf8c5aab9
10:09:36  JCL      - eacf70634f based on jdk-16+32)

To rebuild the failed tests in =https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder, use the following links: 11:26:53 https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder/parambuild/?JDK_VERSION=16&JDK_IMPL=openj9&BUILD_LIST=openjdk&PLATFORM=x86-64_linux&TARGET=jdk_foreign_native_0

Optional info

Failure output (captured from console output)

[2021-01-22T16:23:35.757Z] Running test jdk_foreign_native_0 ...
[2021-01-22T16:23:35.757Z] ===============================================
[2021-01-22T16:23:47.622Z] [TestNG] Running:
[2021-01-22T16:23:47.622Z]   java/foreign/TestNative.java
[2021-01-22T16:23:47.622Z] 
[2021-01-22T16:23:47.622Z] test TestNative.testBadResize(): success
[2021-01-22T16:23:47.622Z] test TestNative.testDefaultAccessModes(): failure
[2021-01-22T16:23:47.630Z] java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: jdk/internal/foreign/abi/ProgrammableInvoker.registerNatives()V
[2021-01-22T16:23:47.630Z]  at jdk.incubator.foreign/jdk.internal.foreign.abi.SharedUtils.allocateMemoryInternal(SharedUtils.java:285)
[2021-01-22T16:23:47.630Z]  at jdk.incubator.foreign/jdk.incubator.foreign.CLinker.allocateMemoryRestricted(CLinker.java:396)
[2021-01-22T16:23:47.630Z]  at TestNative.allocate(TestNative.java:147)
[2021-01-22T16:23:47.630Z]  at TestNative.testDefaultAccessModes(TestNative.java:176)
[2021-01-22T16:23:47.630Z]  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2021-01-22T16:23:47.630Z]  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
[2021-01-22T16:23:47.630Z]  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2021-01-22T16:23:47.630Z]  at java.base/java.lang.reflect.Method.invoke(Method.java:567)
[2021-01-22T16:23:47.630Z]  at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
[2021-01-22T16:23:47.630Z]  at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
[2021-01-22T16:23:47.630Z]  at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
[2021-01-22T16:23:47.630Z]  at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
[2021-01-22T16:23:47.630Z]  at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
[2021-01-22T16:23:47.632Z]  at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
[2021-01-22T16:23:47.632Z]  at org.testng.TestRunner.privateRun(TestRunner.java:773)
[2021-01-22T16:23:47.632Z]  at org.testng.TestRunner.run(TestRunner.java:623)
[2021-01-22T16:23:47.632Z]  at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
[2021-01-22T16:23:47.632Z]  at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
[2021-01-22T16:23:47.632Z]  at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
[2021-01-22T16:23:47.632Z]  at org.testng.SuiteRunner.run(SuiteRunner.java:259)
[2021-01-22T16:23:47.632Z]  at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
[2021-01-22T16:23:47.632Z]  at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
[2021-01-22T16:23:47.632Z]  at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
[2021-01-22T16:23:47.632Z]  at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
[2021-01-22T16:23:47.632Z]  at org.testng.TestNG.run(TestNG.java:1018)
[2021-01-22T16:23:47.632Z]  at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
[2021-01-22T16:23:47.632Z]  at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54)
[2021-01-22T16:23:47.632Z]  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2021-01-22T16:23:47.632Z]  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
[2021-01-22T16:23:47.632Z]  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2021-01-22T16:23:47.632Z]  at java.base/java.lang.reflect.Method.invoke(Method.java:567)
[2021-01-22T16:23:47.632Z]  at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
[2021-01-22T16:23:47.632Z]  at java.base/java.lang.Thread.run(Thread.java:853)
[2021-01-22T16:23:47.632Z] Caused by: java.lang.UnsatisfiedLinkError: jdk/internal/foreign/abi/ProgrammableInvoker.registerNatives()V
[2021-01-22T16:23:47.632Z]  at jdk.incubator.foreign/jdk.internal.foreign.abi.ProgrammableInvoker.<clinit>(ProgrammableInvoker.java:384)
[2021-01-22T16:23:47.632Z]  at jdk.incubator.foreign/jdk.internal.foreign.abi.x64.sysv.CallArranger.arrangeDowncall(CallArranger.java:129)
[2021-01-22T16:23:47.632Z]  at jdk.incubator.foreign/jdk.internal.foreign.abi.x64.sysv.SysVx64Linker.downcallHandle(SysVx64Linker.java:93)
[2021-01-22T16:23:47.632Z]  at jdk.incubator.foreign/jdk.internal.foreign.abi.SharedUtils$AllocHolder.<clinit>(SharedUtils.java:272)
[2021-01-22T16:23:47.632Z]  at jdk.incubator.foreign/jdk.internal.foreign.abi.SharedUtils.allocateMemoryInternal(SharedUtils.java:283)
[2021-01-22T16:23:47.632Z]  ... 32 more

[2021-01-22T16:23:47.635Z] ===============================================
[2021-01-22T16:23:47.635Z] java/foreign/TestNative.java
[2021-01-22T16:23:47.635Z] Total tests run: 19, Failures: 3, Skips: 0
[2021-01-22T16:23:47.635Z] ===============================================
pshipton commented 3 years ago

FYI https://github.com/eclipse/openj9/issues/11724. This seems like an internal build setup problem.

JasonFengJ9 commented 3 years ago

11724 was the initial error.

This jdk/internal/foreign/abi/ProgrammableInvoker.registerNatives()V is related to Foreign Linker API. @tajila mentioned that OpenJ9 might take different approach and not require this native and its friends within jdk/internal/foreign/abi/ProgrammableInvoker. I create this issue to track this java/foreign/TestNative.java error until OpenJ9 has its own implementation.

pshipton commented 3 years ago

@smlambert this won't be resolved until the 0.26 release, what is the best way to exclude this test from jdk_foreign_native, considering it's already excluded in the regular exclude list?

smlambert commented 3 years ago

Is it only to be excluded for jdk16? or 16+?

Since its moved into its own test target in the playlist file, its now easy to exclude (based on https://github.com/AdoptOpenJDK/openjdk-tests/blob/master/doc/userGuide.md#exclude-a-test-target), I can either manually change the playlist file to add a disabled section

<test>
    <testCaseName>jdk_foreign_native</testCaseName>
        <disabled>
            <comment>https://github.com/AdoptOpenJDK/openjdk-tests/issues/123456</comment>
            <impl>openj9</impl>
            <subset>16+</subset>
    </disabled>
...

or use the auto exclude feature we now have at the openjdk-tests repo and type

auto exclude test jdk_foreign_native impl=openj9 ver=16+

in a related openjdk-tests issue (which would then automatically create a PR to exclude the test target.

smlambert commented 3 years ago

Let me know version (16 or 16+), and is it all platforms?

tajila commented 3 years ago

@smlambert all platforms and 16+

smlambert commented 3 years ago

Excluded via https://github.com/AdoptOpenJDK/openjdk-tests/pull/2219

smlambert commented 3 years ago

Soon enough, openj9 will have some auto exclude features: https://github.com/eclipse/openj9/pull/11785 ;)

JasonFengJ9 commented 2 years ago

OpenJ9 has its own jdk/internal/foreign/abi/ProgrammableInvoker w/o registerNatives(), the native binding are done differently from RI. This test can't apply to OpenJ9. Moving to backlog.