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

JavaLeakTests failing on Java 23 #1664

Open
akurtakov opened this issue Sep 20, 2024 · 8 comments
Open

JavaLeakTests failing on Java 23 #1664

akurtakov opened this issue Sep 20, 2024 · 8 comments
Labels
test junit test related things

Comments

@akurtakov
Copy link
Contributor

Failures are like 'Can not get final java.lang.Class field java.lang.Class.componentType on java.lang.Class'

See https://download.eclipse.org/eclipse/downloads/drops4/I20240919-1230/testresults/html/org.eclipse.jdt.ui.tests_ep434I-unit-cen64-gtk3-java23_linux.gtk.x86_64_23.html for details.

@eclipse-jdt eclipse-jdt deleted a comment Sep 20, 2024
@akurtakov
Copy link
Contributor Author

@noopur2507 You seem to be the one involved with this failing on Java 17 so would you please look into it?

@noopur2507
Copy link
Member

I am not sure if these were tests enabled based on the discussion in #23.

@noopur2507
Copy link
Member

Also, I don't see any test failures in the last Y-build on gtk3-java23.
https://download.eclipse.org/eclipse/downloads/drops4/Y20240918-1000/testResults.php

@MohananRahul @stephan-herrmann any idea what changed?

@jukzi jukzi added the test junit test related things label Sep 20, 2024
@jukzi
Copy link
Contributor

jukzi commented Sep 20, 2024

Stacktrace for the record:

Can not get final java.lang.Class field java.lang.Class.componentType on java.lang.Class

java.lang.IllegalArgumentException: Can not get final java.lang.Class field java.lang.Class.componentType on java.lang.Class
at java.base/jdk.internal.reflect.MethodHandleFieldAccessorImpl.newGetIllegalArgumentException(MethodHandleFieldAccessorImpl.java:86)
at java.base/jdk.internal.reflect.MethodHandleObjectFieldAccessorImpl.get(MethodHandleObjectFieldAccessorImpl.java:61)
at java.base/java.lang.reflect.Field.get(Field.java:444)
at org.eclipse.jdt.ui.leaktest.reftracker.ReferenceTracker.followFieldReference(ReferenceTracker.java:80)
at org.eclipse.jdt.ui.leaktest.reftracker.ReferenceTracker.visit(ReferenceTracker.java:144)
at org.eclipse.jdt.ui.leaktest.reftracker.ReferenceTracker.start(ReferenceTracker.java:168)
at org.eclipse.jdt.ui.leaktest.LeakTestCase.collect(LeakTestCase.java:58)
at org.eclipse.jdt.ui.leaktest.LeakTestCase.assertInstanceCount(LeakTestCase.java:123)
at org.eclipse.jdt.ui.tests.leaks.JavaLeakTest.internalTestEditorOpen(JavaLeakTest.java:378)
at org.eclipse.jdt.ui.tests.leaks.JavaLeakTest.testJavaEditorActionDelegate(JavaLeakTest.java:465)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)

the field is rather old:
https://github.com/openjdk/jdk/blame/e087edeb256a9743d1fdb6c295cb5add78d4552e/src/java.base/share/classes/java/lang/Class.java#L1411

The IllegalArgumentException hides a ClassCastException which would be nice to have::
https://github.com/openjdk/jdk/blob/e087edeb256a9743d1fdb6c295cb5add78d4552e/src/java.base/share/classes/jdk/internal/reflect/MethodHandleObjectFieldAccessorImpl.java#L60

looks like a error in JDK

java.vm.version=23+37-2369

the Y build instead uses
java.vm.version=23-ea+27-2275

@stephan-herrmann
Copy link
Contributor

Also, I don't see any test failures in the last Y-build on gtk3-java23. https://download.eclipse.org/eclipse/downloads/drops4/Y20240918-1000/testResults.php

@MohananRahul @stephan-herrmann any idea what changed?

I can locally reproduce on jdk-23+37.

The original ClassCastException reads: Cannot cast [I to java.lang.Class

And indeed the debugger shows Class.componentType to hold as its value an empty array.

Am I having a deja vu? See #2 (comment) :)

@jukzi
Copy link
Contributor

jukzi commented Sep 24, 2024

I can locally reproduce on jdk-23+37.

do you agree its a JDK bug? Mind to file a error report to JDK how to reproduce?

@stephan-herrmann
Copy link
Contributor

I can locally reproduce on jdk-23+37.

do you agree its a JDK bug?

That's the feeling I already had in February ...

Mind to file a error report to JDK how to reproduce?

I don't think Oracle / openjdk wants to run JavaLeakTests, and atm I have no idea how to reduce this to a small reproducer.

Reminds me, I still need to file the recent JIT bug - let's see how they'll react to that one.

@stephan-herrmann
Copy link
Contributor

in #2 I mentioned that the bug occurs with JDK 18+. This isn't wrong, but interestingly, from those JDKs 18+ I have on disk, 20, 21 and 22 do not show the bug, but 23 does again.

I should add, however, that I didn't repeat each of the test runs to check if the bug happens / does not happen reliably. I gave up partly because since today (?) equinox startup takes more than a minute on my machine with several cpu cores at 100%. Anybody else seeing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test junit test related things
Projects
None yet
Development

No branches or pull requests

4 participants