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

AOT testing StackWalkerTest_0 testClassLoaderName AssertionError: Wrong classloader name expected [TestMyloaderInstance] but found [null] #20368

Closed
pshipton opened this issue Oct 16, 2024 · 9 comments

Comments

@pshipton
Copy link
Member

pshipton commented Oct 16, 2024

https://openj9-jenkins.osuosl.org/job/Test_openjdk11_j9_extended.functional_s390x_linux_aot_Personal_testList_1/294

Still failing in the latest builds, on both tested versions jdk11 and jdk17.
https://openj9-jenkins.osuosl.org/job/Pipeline-Build-Test-AOT/327/

StackWalkerTest_0

12:51:01  OpenJDK Runtime Environment (build 11.0.25-internal+0-adhoc.****.BuildJDK11s390xlinuxaotPersonal)
12:51:01  Eclipse OpenJ9 VM (build master-16ab797349b, JRE 11 Linux s390x-64-Bit Compressed References 20240924_300 (JIT enabled, AOT enabled)
12:51:01  OpenJ9   - 16ab797349b
12:51:01  OMR      - 611c142075f
12:51:01  JCL      - 3d65f3fd583 based on jdk-11.0.25+6)

18:35:20  "/home/jenkins/workspace/Test_openjdk11_j9_extended.functional_s390x_linux_aot_Personal_testList_1/jdkbinary/j2sdk-image/bin/java" -Xshareclasses:name=test_aot -Xscmx400M -Xscmaxaot256m  -Xint  \
18:35:20  -cp "/home/jenkins/workspace/Test_openjdk11_j9_extended.functional_s390x_linux_aot_Personal_testList_1/aqa-tests/TKG/../../jvmtest/TestConfig/resources:/home/jenkins/workspace/Test_openjdk11_j9_extended.functional_s390x_linux_aot_Personal_testList_1/../../testDependency/lib/testng.jar:/home/jenkins/workspace/Test_openjdk11_j9_extended.functional_s390x_linux_aot_Personal_testList_1/../../testDependency/lib/jcommander.jar:/home/jenkins/workspace/Test_openjdk11_j9_extended.functional_s390x_linux_aot_Personal_testList_1/aqa-tests/TKG/../../jvmtest/functional/Java9andUp/GeneralTest.jar" \
18:35:20  org.testng.TestNG -d "/home/jenkins/workspace/Test_openjdk11_j9_extended.functional_s390x_linux_aot_Personal_testList_1/aqa-tests/TKG/../TKG/output_17271977954965/StackWalkerTest_0_AOT_ITER_$aotItercnt" "/home/jenkins/workspace/Test_openjdk11_j9_extended.functional_s390x_linux_aot_Personal_testList_1/aqa-tests/TKG/../../jvmtest/functional/Java9andUp/testng.xml" -testnames StackWalkerTest \
18:35:20  -groups level.extended \
18:35:20  -excludegroups d.*.linux_390-64,d.*.arch.390,d.*.os.linux,d.*.bits.64,d.*.generic-all

18:35:20  === AOT ITERATION 1 ===

18:35:22  FAILED: testClassLoaderName
18:35:22  java.lang.AssertionError: Wrong classloader name expected [TestMyloaderInstance] but found [null]
18:35:22  	at org.testng.Assert.fail(Assert.java:96)
18:35:22  	at org.testng.Assert.failNotEquals(Assert.java:776)
18:35:22  	at org.testng.Assert.assertEqualsImpl(Assert.java:132)
18:35:22  	at org.testng.Assert.assertEquals(Assert.java:118)
18:35:22  	at org.testng.Assert.assertEquals(Assert.java:453)
18:35:22  	at org.openj9.test.stackWalker.MyRunnable.run(MyRunnable.java:45)
18:35:22  	at org.openj9.test.stackWalker.StackWalkerTest.testClassLoaderName(StackWalkerTest.java:243)

Last known working build

07:17:28  OpenJDK Runtime Environment (build 11.0.25-internal+0-adhoc.****.BuildJDK11s390xlinuxaotPersonal)
07:17:28  Eclipse OpenJ9 VM (build master-0985ff3f82b, JRE 11 Linux s390x-64-Bit Compressed References 20240917_298 (JIT enabled, AOT enabled)
07:17:28  OpenJ9   - 0985ff3f82b
07:17:28  OMR      - 10fdf657a92
07:17:28  JCL      - 5998a93447c based on jdk-11.0.25+6)

0985ff3...16ab797
eclipse-openj9/openj9-omr@10fdf65...611c142

Copy link

Issue Number: 20368
Status: Open
Recommended Components: comp:test, comp:vm, comp:gc
Recommended Assignees: llxia, jasonfengj9, pshipton

@pshipton
Copy link
Member Author

@hangshao0 can you pls take a look. It's failing in the first run, so not AOT, but running with -Xshareclasses:name=test_aot, which is different from the nightly builds where it doesn't fail.

@hangshao0
Copy link
Contributor

It is likely due to #20169.

Before this change findJ9ClassForROMClass() was able to change the resultClassLoader from bootstrap class loader to testMyloader so the test passed. I believe #20169 changed the behaviour of findJ9ClassForROMClass() somehow that resultClassLoader is not updated to testMyloader. classloader name null means it still points to bootstrap class loader.

@theresa-m Could you take a look at this ?
You can verify things simply running the test with option -Xshareclasses:name=test_aot.

@hangshao0
Copy link
Contributor

I don't see the code updating the resultClassLoader if class is found in the hashtable:

if (NULL != resultEntry) {
ret = resultEntry->ramClass;
goto done;
}

@pshipton
Copy link
Member Author

Do you think this is something we should fix in 0.48?

@theresa-m
Copy link
Contributor

I will take a look.

@hangshao0
Copy link
Contributor

Do you think this is something we should fix in 0.48?

Yes, if the final fix is small and has low risk.

@theresa-m
Copy link
Contributor

I tested StackWalkerTest_0 locally with -Xshareclasses:name=test_aot and it passes with #20371.

Copy link

Issue Number: 20368
Status: Closed
Actual Components: comp:vm, test failure
Actual Assignees: No one :(
PR Assignees: theresa-m, theresa-m

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