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

Failure in LoaderLeakTest #13201

Open
tajila opened this issue Jul 15, 2021 · 9 comments
Open

Failure in LoaderLeakTest #13201

tajila opened this issue Jul 15, 2021 · 9 comments

Comments

@tajila
Copy link
Contributor

tajila commented Jul 15, 2021

It appears that we are hanging while running the loader leak test.

Agent error: java.lang.Exception: Agent 6 timed out with a timeout of 960 seconds; check console log for any additional details    

java/lang/annotation/LoaderLeakTest.java.LoaderLeakTest

@tajila tajila added this to the Release 0.28 (Java 17) milestone Jul 15, 2021
tajila added a commit to tajila/openjdk-tests that referenced this issue Jul 15, 2021
Associated issue eclipse-openj9/openj9#13201

Signed-off-by: Tobi Ajila <atobia@ca.ibm.com>
tajila added a commit to tajila/openjdk-tests that referenced this issue Jul 15, 2021
Associated issue eclipse-openj9/openj9#13201

Signed-off-by: Tobi Ajila <atobia@ca.ibm.com>
smlambert pushed a commit to adoptium/aqa-tests that referenced this issue Jul 15, 2021
Associated issue eclipse-openj9/openj9#13201

Signed-off-by: Tobi Ajila <atobia@ca.ibm.com>
@tajila
Copy link
Contributor Author

tajila commented Aug 9, 2021

@hangshao0 Can you please take a look at this. Just need to determine if its JVM issue or something else.

@hangshao0
Copy link
Contributor

There is an infinite loop in the test. It expects a weak reference to be cleared by System.gc(). It is not cleared and we never get out of the loop, so the test fails on timeout.

https://github.com/ibmruntimes/openj9-openjdk-jdk17/blob/c9d6bc450c26f4ea6132e1ebed6b60d04a47f0aa/test/jdk/java/lang/annotation/LoaderLeakTest.java#L90-L93

I guess the GC team needs to take a look.

@tajila
Copy link
Contributor Author

tajila commented Aug 9, 2021

@dmitripivkine does calling System.gc() provide any guarantees about weak references being cleared?

@dmitripivkine
Copy link
Contributor

dmitripivkine commented Aug 16, 2021

In general calling System.gc() in the loop multiple times (and left time between for Finalization threads to run) must clean all weak referenced objects available for it (in my practice calling System.gc() 3-4 times with 1s delay between is enough). However Weak Reference can not be cleared if referent has a strong root. Also weak referencing is applicable to objects referenced from referent slot. All other objects slots in Weak Reference object behaves as regular (strong) reference.

If we do have system core it is possible to locate Weak Refs in question and check is referent strong referenced. So if you provide system core I can take a look.

@dmitripivkine
Copy link
Contributor

dmitripivkine commented Aug 16, 2021

Also you can try -Xint. JIT might put reference to referent to O-slot as optimization so create a strong root.
There is an issue for reference #9969
Looks like there is more precise option to try -Xjit:enableAggressiveLiveness

@dmitripivkine
Copy link
Contributor

Also looking to the test source - there is an extra possibility: GC provides extra liveness for classloader object / each class object for class in this classloader if there is instance of class is alive (strong referenced) in the heap (for any class in this classloader). If it is a case classloader can not be unloaded and stays alive, all classes are marked as a strong roots.

@hangshao0
Copy link
Contributor

Looks like there is more precise option to try -Xjit:enableAggressiveLiveness

The timeout goes away and test successfully passed with -Xjit:enableAggressiveLiveness.

@dmitripivkine
Copy link
Contributor

So looks like there is a JIT feature to make test fail. Yes, it makes test incompatible but itself it just introduces different (not wrong) behaviour for JVM. I believe JIT experts can provide a proper conclusion
@0xdaryl FYI

pshipton added a commit to pshipton/openjdk-tests that referenced this issue Feb 22, 2023
It's excluded on jdk17+. The test is added to jdk11 11.0.19.

Issue eclipse-openj9/openj9#13201

Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>
pshipton added a commit to pshipton/openjdk-tests that referenced this issue Feb 22, 2023
It's excluded on jdk17+. The test is added to jdk11 in 11.0.19.

Issue eclipse-openj9/openj9#13201

Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>
@pshipton
Copy link
Member

The test was backported to jdk11 in 11.0.19. Created adoptium/aqa-tests#4357 to exclude it there.

pshipton added a commit to pshipton/openjdk-tests that referenced this issue Feb 22, 2023
It's excluded on jdk17+. The test is added to jdk11 in 11.0.19.

Issue eclipse-openj9/openj9#13201

Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>
llxia pushed a commit to adoptium/aqa-tests that referenced this issue Feb 22, 2023
It's excluded on jdk17+. The test is added to jdk11 in 11.0.19.

Issue eclipse-openj9/openj9#13201

Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>
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

6 participants