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

ArrayIndexOutOfBoundsException jdk.internal.util.ArraysSupport.hashCode #20833

Open
pshipton opened this issue Dec 13, 2024 · 5 comments
Open

Comments

@pshipton
Copy link
Member

https://openj9-jenkins.osuosl.org/job/Test_openjdk23_j9_sanity.functional_x86-64_linux_Nightly_testList_0/115
jsr335tests_none_SCC_3 -Xcompressedrefs -Xjit -Xgcpolicy:optthruput

03:48:33  Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
03:48:33  	at java.base/jdk.internal.util.ArraysSupport.hashCode(ArraysSupport.java:324)
03:48:33  	at java.base/java.util.Arrays.hashCode(Arrays.java:4570)
03:48:33  	at java.base/sun.reflect.annotation.AnnotationInvocationHandler.memberValueHashCode(AnnotationInvocationHandler.java:637)
03:48:33  	at java.base/sun.reflect.annotation.AnnotationInvocationHandler.hashCodeImpl(AnnotationInvocationHandler.java:607)
03:48:33  	at java.base/sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:77)
03:48:33  	at jdk.proxy2/jdk.proxy2.$Proxy2.hashCode(Unknown Source)
03:48:33  	at org.testng.internal.collections.Pair.hashCode(Pair.java:30)
03:48:33  	at java.base/java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:944)
03:48:33  	at org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(JDK15AnnotationFinder.java:222)
03:48:33  	at org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(JDK15AnnotationFinder.java:199)
03:48:33  	at org.testng.internal.BaseTestMethod.initGroups(BaseTestMethod.java:424)
03:48:33  	at org.testng.internal.TestNGMethod.init(TestNGMethod.java:101)
03:48:33  	at org.testng.internal.TestNGMethod.<init>(TestNGMethod.java:42)
03:48:33  	at org.testng.internal.TestNGMethod.<init>(TestNGMethod.java:33)
03:48:33  	at org.testng.internal.annotations.AnnotationHelper.findMethodsWithAnnotation(AnnotationHelper.java:241)
03:48:33  	at org.testng.internal.TestNGMethodFinder.getTestMethods(TestNGMethodFinder.java:53)
03:48:33  	at org.testng.TestClass.initMethods(TestClass.java:115)
03:48:33  	at org.testng.TestClass.init(TestClass.java:74)
@pshipton
Copy link
Member Author

pshipton commented Dec 18, 2024

https://openj9-jenkins.osuosl.org/job/Test_openjdk23_j9_sanity.functional_x86-64_linux_Nightly_testList_0/118
JCL_Test_none_SCC_1 -Xshareclasses:none -XX:RecreateClassfileOnload

03:27:24  Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
03:27:24  	at java.base/jdk.internal.util.ArraysSupport.hashCode(ArraysSupport.java:324) from jrt:/java.base
03:27:24  	at java.base/java.util.Arrays.hashCode(Arrays.java:4570) from jrt:/java.base
03:27:24  	at java.base/sun.reflect.annotation.AnnotationInvocationHandler.memberValueHashCode(AnnotationInvocationHandler.java:637) from jrt:/java.base
03:27:24  	at java.base/sun.reflect.annotation.AnnotationInvocationHandler.hashCodeImpl(AnnotationInvocationHandler.java:607) from jrt:/java.base
03:27:24  	at java.base/sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:77) from jrt:/java.base
03:27:24  	at jdk.proxy2/jdk.proxy2.$Proxy2.hashCode(Unknown Source)
03:27:24  	at org.testng.internal.collections.Pair.hashCode(Pair.java:30) from jdk.internal.loader.ClassLoaders$AppClassLoader@b609e475(file:/home/jenkins/testDependency/lib/testng.jar)
03:27:24  	at java.base/java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:944) from jrt:/java.base
03:27:24  	at org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(JDK15AnnotationFinder.java:222) from jdk.internal.loader.ClassLoaders$AppClassLoader@b609e475(file:/home/jenkins/testDependency/lib/testng.jar)
03:27:24  	at org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(JDK15AnnotationFinder.java:107) from jdk.internal.loader.ClassLoaders$AppClassLoader@b609e475(file:/home/jenkins/testDependency/lib/testng.jar)
03:27:24  	at org.testng.internal.annotations.AnnotationHelper.findTest(AnnotationHelper.java:60) from jdk.internal.loader.ClassLoaders$AppClassLoader@b609e475(file:/home/jenkins/testDependency/lib/testng.jar)
03:27:24  	at org.testng.internal.MethodHelper.isEnabled(MethodHelper.java:163) from jdk.internal.loader.ClassLoaders$AppClassLoader@b609e475(file:/home/jenkins/testDependency/lib/testng.jar)
03:27:24  	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:873) from jdk.internal.loader.ClassLoaders$AppClassLoader@b609e475(file:/home/jenkins/testDependency/lib/testng.jar)
03:27:24  	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) from jdk.internal.loader.ClassLoaders$AppClassLoader@b609e475(file:/home/jenkins/testDependency/lib/testng.jar)
03:27:24  	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) from jdk.internal.loader.ClassLoaders$AppClassLoader@b609e475(file:/home/jenkins/testDependency/lib/testng.jar)
03:27:24  	at org.testng.TestRunner.privateRun(TestRunner.java:648) from jdk.internal.loader.ClassLoaders$AppClassLoader@b609e475(file:/home/jenkins/testDependency/lib/testng.jar)
03:27:24  	at org.testng.TestRunner.run(TestRunner.java:505) from jdk.internal.loader.ClassLoaders$AppClassLoader@b609e475(file:/home/jenkins/testDependency/lib/testng.jar)

@pshipton
Copy link
Member Author

@hzongaro fyi

@hzongaro
Copy link
Member

@BradleyWood, is this likely to be caused by the same problem reported in #20824, and fixed in #20838?

@BradleyWood
Copy link
Member

@hzongaro I'm not sure whats happening here. Based on the line numbers the stack trace, that is an object array hashcode. Although the timing of this test failure is suspicious I don't see how this would relate to the vectorizedHashCode PR, because that is for integers.

@hzongaro
Copy link
Member

hzongaro commented Dec 20, 2024

It's possible this is fixed by pull request #20849. The method sun/reflect/annotation/AnnotationInvocationHandler.memberValueHashCode contains several calls to Arrays.hashCode that cast the array to a primitive array type or to Object[] depending on the component type of the array. If some of those calls resulted in inlined calls to ArraysSupport.vectorizedHashCode, problems with register spills could have resulted.

I haven't been able to reproduce the failures, but if we go a few weeks without seeing these failures again, I think we can guess that that was the cause of this problem.

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