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 721 forks source link

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

Open pshipton opened 2 hours ago

pshipton commented 2 hours ago

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)

https://github.com/eclipse-openj9/openj9/compare/0985ff3f82b...16ab797349b https://github.com/eclipse-openj9/openj9-omr/compare/10fdf657a92...611c142075f

github-actions[bot] commented 2 hours ago

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

pshipton commented 2 hours ago

@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 commented 1 hour ago

It is likely due to https://github.com/eclipse-openj9/openj9/pull/20169/.

Before this change findJ9ClassForROMClass() was able to change the resultClassLoader from bootstrap class loader to testMyloader so the test passed. I believe https://github.com/eclipse-openj9/openj9/pull/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 commented 1 hour ago

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

https://github.com/eclipse-openj9/openj9/blob/d38a818d230d08447a10a9dd69eb7fb6ef2d1236/runtime/vm/exceptiondescribe.c#L259-L262

pshipton commented 1 hour ago

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