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.28k stars 722 forks source link

java.lang.LinkageError: loading constraint violation in ValueTypeTests #20189

Open hangshao0 opened 1 month ago

hangshao0 commented 1 month ago

Failed in Valhalla nightly build:

21:56:22  FAILED: testDefaultValues
21:56:22  java.lang.IllegalAccessException: no such method: Triangle2D.makeDefaultValue()Triangle2D/invokeStatic
21:56:22    at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:930)
21:56:22    at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1013)
21:56:22    at java.base/java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3761)
21:56:22    at java.base/java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:2654)
21:56:22    at org.openj9.test.lworld.ValueTypeTests.testDefaultValues(ValueTypeTests.java:1832)
21:56:22    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
21:56:22    at java.base/java.lang.reflect.Method.invoke(Method.java:579)
21:56:22    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
21:56:22    at org.testng.internal.Invoker.invokeMethod(Invoker.java:580)
21:56:22    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:716)
21:56:22    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:988)
21:56:22    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
21:56:22    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
21:56:22    at org.testng.TestRunner.privateRun(TestRunner.java:648)
21:56:22    at org.testng.TestRunner.run(TestRunner.java:505)
21:56:22    at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
21:56:22    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
21:56:22    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
21:56:22    at org.testng.SuiteRunner.run(SuiteRunner.java:364)
21:56:22    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
21:56:22    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
21:56:22    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
21:56:22    at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
21:56:22    at org.testng.TestNG.runSuites(TestNG.java:1049)
21:56:22    at org.testng.TestNG.run(TestNG.java:1017)
21:56:22    at org.testng.TestNG.privateMain(TestNG.java:1354)
21:56:22    at org.testng.TestNG.main(TestNG.java:1323)
21:56:22  Caused by: java.lang.LinkageError: loading constraint violation when resolving method "Triangle2D.makeDefaultValue()LTriangle2D;" : loader "jdk/internal/loader/ClassLoaders$AppClassLoader@a1eb1792" of class "org/openj9/test/lworld/ValueTypeTests" and loader "org/openj9/test/lworld/ValueTypeGenerator@176a3bf" of class "Triangle2D" have different types for the method signature
21:56:22    at java.base/java.lang.invoke.MethodHandleNatives.resolve(Native Method)
21:56:22    at java.base/java.lang.invoke.MemberName$Factory.resolve(MemberName.java:981)
21:56:22    at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1010)
21:56:22    ... 25 more

This failure is intermittent.

50x grinder all passed.

hangshao0 commented 1 month ago

FYI @theresa-m

hangshao0 commented 1 month ago

Failed again here:

21:53:25  FAILED: testDefaultValues
21:53:25  java.lang.IllegalAccessException: no such method: Triangle2D.makeDefaultValue()Triangle2D/invokeStatic
21:53:25    at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:930)
21:53:25    at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1013)
21:53:25    at java.base/java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3761)
21:53:25    at java.base/java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:2654)
21:53:25    at org.openj9.test.lworld.ValueTypeTests.testDefaultValues(ValueTypeTests.java:1832)
21:53:25    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
21:53:25    at java.base/java.lang.reflect.Method.invoke(Method.java:579)
21:53:25    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
21:53:25    at java.base/java.lang.ThreadLocal$ThreadLocalMap.set(ThreadLocal.java:545)
21:53:25    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:716)
21:53:25    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:988)
21:53:25    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
21:53:25    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
21:53:25    at org.testng.TestRunner.privateRun(TestRunner.java:648)
21:53:25    at org.testng.TestRunner.run(TestRunner.java:505)
21:53:25    at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
21:53:25    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
21:53:25    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
21:53:25    at org.testng.SuiteRunner.run(SuiteRunner.java:364)
21:53:25    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
21:53:25    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
21:53:25    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
21:53:25    at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
21:53:25    at org.testng.TestNG.runSuites(TestNG.java:1049)
21:53:25    at org.testng.TestNG.run(TestNG.java:1017)
21:53:25    at org.testng.TestNG.privateMain(TestNG.java:1354)
21:53:25    at org.testng.TestNG.main(TestNG.java:1323)
21:53:25  Caused by: java.lang.LinkageError: loading constraint violation when resolving method "Triangle2D.makeDefaultValue()LTriangle2D;" : loader "jdk/internal/loader/ClassLoaders$AppClassLoader@4868a333" of class "org/openj9/test/lworld/ValueTypeTests" and loader "org/openj9/test/lworld/ValueTypeGenerator@314cb77" of class "Triangle2D" have different types for the method signature
21:53:25    at java.base/java.lang.invoke.MethodHandleNatives.resolve(Native Method)
21:53:25    at java.base/java.lang.invoke.MemberName$Factory.resolve(MemberName.java:981)
21:53:25    at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1010)
21:53:25    ... 25 more
theresa-m commented 1 month ago

Could this be similar to https://github.com/eclipse-openj9/openj9/issues/11924 ? @babsingh

babsingh commented 1 month ago

No, they aren't similar. The old one failed consistently and a fix was pushed for it. This one is intermittent, and two different method signatures are found for Triangle2D.makeDefaultValue()LTriangle2D at some point. Further investigation will be needed to figure out why two different method signatures are intermittently found. This might be related SCC/AOT.

theresa-m commented 1 month ago

Okay thanks!

a7ehuo commented 3 weeks ago

I just ran into this issue in an internal Test_openjdkvalhalla_j9_sanity.functional_x86-64_linux_valhalla.

I tried to run ValueTypeTests_2 locally 80x, all passed.

2024-10-22T14:40:05.031Z] FAILED: testDefaultValues
[2024-10-22T14:40:05.031Z] java.lang.IllegalAccessException: no such method: Triangle2D.makeDefaultValue()Triangle2D/invokeStatic
[2024-10-22T14:40:05.031Z]  at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:930)
[2024-10-22T14:40:05.031Z]  at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1013)
[2024-10-22T14:40:05.031Z]  at java.base/java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3761)
[2024-10-22T14:40:05.031Z]  at java.base/java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:2654)
[2024-10-22T14:40:05.031Z]  at org.openj9.test.lworld.ValueTypeTests.testDefaultValues(ValueTypeTests.java:1832)
[2024-10-22T14:40:05.031Z]  at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[2024-10-22T14:40:05.031Z]  at java.base/java.lang.reflect.Method.invoke(Method.java:579)
[2024-10-22T14:40:05.031Z]  at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
[2024-10-22T14:40:05.031Z]  at org.testng.internal.Invoker.invokeMethod(Invoker.java:580)
[2024-10-22T14:40:05.031Z]  at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:716)
[2024-10-22T14:40:05.031Z]  at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:988)
[2024-10-22T14:40:05.031Z]  at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
[2024-10-22T14:40:05.031Z]  at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
[2024-10-22T14:40:05.031Z]  at org.testng.TestRunner.privateRun(TestRunner.java:648)
[2024-10-22T14:40:05.031Z]  at org.testng.TestRunner.run(TestRunner.java:505)
[2024-10-22T14:40:05.031Z]  at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
[2024-10-22T14:40:05.031Z]  at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
[2024-10-22T14:40:05.031Z]  at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
[2024-10-22T14:40:05.031Z]  at org.testng.SuiteRunner.run(SuiteRunner.java:364)
[2024-10-22T14:40:05.031Z]  at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
[2024-10-22T14:40:05.031Z]  at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
[2024-10-22T14:40:05.031Z]  at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
[2024-10-22T14:40:05.031Z]  at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
[2024-10-22T14:40:05.031Z]  at org.testng.TestNG.runSuites(TestNG.java:1049)
[2024-10-22T14:40:05.031Z]  at org.testng.TestNG.run(TestNG.java:1017)
[2024-10-22T14:40:05.031Z]  at org.testng.TestNG.privateMain(TestNG.java:1354)
[2024-10-22T14:40:05.031Z]  at org.testng.TestNG.main(TestNG.java:1323)
[2024-10-22T14:40:05.031Z] Caused by: java.lang.LinkageError: loading constraint violation when resolving method "Triangle2D.makeDefaultValue()LTriangle2D;" : loader "jdk/internal/loader/ClassLoaders$AppClassLoader@d07921a6" of class "org/openj9/test/lworld/ValueTypeTests" and loader "org/openj9/test/lworld/ValueTypeGenerator@7fc9ddc" of class "Triangle2D" have different types for the method signature
[2024-10-22T14:40:05.031Z]  at java.base/java.lang.invoke.MethodHandleNatives.resolve(Native Method)
[2024-10-22T14:40:05.031Z]  at java.base/java.lang.invoke.MemberName$Factory.resolve(MemberName.java:981)
[2024-10-22T14:40:05.031Z]  at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1010)
[2024-10-22T14:40:05.031Z]  ... 25 more
a7ehuo commented 2 weeks ago

Hit this failure again with internal test: Test_openjdkValhalla_j9_sanity.functional_aarch64_linux_valhalla

2024-10-28T20:00:47.979Z] FAILED: testDefaultValues
[2024-10-28T20:00:47.979Z] java.lang.IllegalAccessException: no such method: Triangle2D.makeDefaultValue()Triangle2D/invokeStatic
[2024-10-28T20:00:47.979Z]  at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:930)
[2024-10-28T20:00:47.979Z]  at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1013)
[2024-10-28T20:00:47.979Z]  at java.base/java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3761)
[2024-10-28T20:00:47.979Z]  at java.base/java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:2654)
[2024-10-28T20:00:47.979Z]  at org.openj9.test.lworld.ValueTypeTests.testDefaultValues(ValueTypeTests.java:1832)
[2024-10-28T20:00:47.979Z]  at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[2024-10-28T20:00:47.979Z]  at java.base/java.lang.reflect.Method.invoke(Method.java:579)
[2024-10-28T20:00:47.979Z]  at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
[2024-10-28T20:00:47.979Z]  at <unknown class>.<unknown method>(Unknown Source)
[2024-10-28T20:00:47.979Z]  at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:716)
[2024-10-28T20:00:47.979Z]  at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:988)
[2024-10-28T20:00:47.979Z]  at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
[2024-10-28T20:00:47.979Z]  at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
[2024-10-28T20:00:47.979Z]  at org.testng.TestRunner.privateRun(TestRunner.java:648)
[2024-10-28T20:00:47.979Z]  at org.testng.TestRunner.run(TestRunner.java:505)
[2024-10-28T20:00:47.979Z]  at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
[2024-10-28T20:00:47.979Z]  at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
[2024-10-28T20:00:47.979Z]  at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
[2024-10-28T20:00:47.979Z]  at org.testng.SuiteRunner.run(SuiteRunner.java:364)
[2024-10-28T20:00:47.979Z]  at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
[2024-10-28T20:00:47.979Z]  at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
[2024-10-28T20:00:47.979Z]  at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
[2024-10-28T20:00:47.979Z]  at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
[2024-10-28T20:00:47.979Z]  at org.testng.TestNG.runSuites(TestNG.java:1049)
[2024-10-28T20:00:47.979Z]  at org.testng.TestNG.run(TestNG.java:1017)
[2024-10-28T20:00:47.979Z]  at org.testng.TestNG.privateMain(TestNG.java:1354)
[2024-10-28T20:00:47.979Z]  at org.testng.TestNG.main(TestNG.java:1323)
[2024-10-28T20:00:47.979Z] Caused by: java.lang.LinkageError: loading constraint violation when resolving method "Triangle2D.makeDefaultValue()LTriangle2D;" : loader "jdk/internal/loader/ClassLoaders$AppClassLoader@a95f0f8" of class "org/openj9/test/lworld/ValueTypeTests" and loader "org/openj9/test/lworld/ValueTypeGenerator@80c34a7" of class "Triangle2D" have different types for the method signature
[2024-10-28T20:00:47.979Z]  at java.base/java.lang.invoke.MethodHandleNatives.resolve(Native Method)
[2024-10-28T20:00:47.979Z]  at java.base/java.lang.invoke.MemberName$Factory.resolve(MemberName.java:981)
[2024-10-28T20:00:47.979Z]  at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1010)
[2024-10-28T20:00:47.979Z]  at java.base/java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3761)
[2024-10-28T20:00:47.979Z]  at java.base/java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:2654)
[2024-10-28T20:00:47.979Z]  at org.openj9.test.lworld.ValueTypeTests.testDefaultValues(ValueTypeTests.java:1832)
[2024-10-28T20:00:47.979Z]  at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[2024-10-28T20:00:47.979Z]  at java.base/java.lang.reflect.Method.invoke(Method.java:579)
[2024-10-28T20:00:47.979Z]  at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
[2024-10-28T20:00:47.979Z]  at <unknown class>.<unknown method>(Unknown Source)
[2024-10-28T20:00:47.979Z]  ... 18 more
[2024-10-28T20:00:47.979Z] 
[2024-10-28T20:00:47.979Z] 
[2024-10-28T20:00:47.979Z] ===============================================
[2024-10-28T20:00:47.979Z]     ValueTypeTests
[2024-10-28T20:00:47.979Z]     Tests run: 139, Failures: 1, Skips: 0
[2024-10-28T20:00:47.979Z] ===============================================
[2024-10-28T20:00:47.979Z] 
[2024-10-28T20:00:47.979Z] 
[2024-10-28T20:00:47.979Z] ===============================================
[2024-10-28T20:00:47.979Z] Valhalla suite
[2024-10-28T20:00:47.979Z] Total tests run: 139, Failures: 1, Skips: 0
[2024-10-28T20:00:47.979Z] ===============================================
[2024-10-28T20:00:47.979Z] 
[2024-10-28T20:00:54.129Z] -----------------------------------
[2024-10-28T20:00:54.129Z] ValueTypeTestsJIT_5_FAILED
[2024-10-28T20:00:54.129Z] -----------------------------------
[2024-10-28T20:00:54.129Z] 
hangshao0 commented 2 weeks ago

https://github.com/eclipse-openj9/openj9/pull/20429/ is adding -Xdump option to ValueTypeTests and ValueTypeTestsJIT to capture more diagnostic information on this error.