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.27k stars 721 forks source link

JDK21 serviceability/jvmti/vthread/FollowReferences/VThreadStackRefTest.java ERROR class VThreadStackRefTest$VThreadMountedJNIReferenced: ref count = 1 (expected 1), thread id = 0 (expected 27) #18426

Open JasonFengJ9 opened 10 months ago

JasonFengJ9 commented 10 months ago

Failure link

From an internal build(sles12x86-rtp-rt6-1):

java version "21.0.1-beta" 2023-10-17
IBM Semeru Runtime Certified Edition 21.0.1+12-202311072239 (build 21.0.1-beta+12-202311072239)
Eclipse OpenJ9 VM 21.0.1+12-202311072239 (build master-70f56555a, JRE 21 Linux amd64-64-Bit Compressed References 20231107_30 (JIT enabled, AOT enabled)
OpenJ9   - 70f56555a
OMR      - 2a9a7f4e4
JCL      - aec9b74fc based on jdk-21.0.1+12)

Rerun in Grinder - Change TARGET to run only the failed test targets.

Optional info

Failure output (captured from console output)

[2023-11-07T23:30:30.394Z] variation: Mode150
[2023-11-07T23:30:30.394Z] JVM_OPTIONS:  -XX:+UseCompressedOops 

[2023-11-07T23:35:32.180Z] TEST: serviceability/jvmti/vthread/FollowReferences/VThreadStackRefTest.java#default

[2023-11-07T23:35:32.181Z] Stack local: index = 0, thread_id = 23
[2023-11-07T23:35:32.181Z]   (0) OK class VThreadStackRefTest$VThreadUnmountedReferenced: ref count = 1 (expected 1), thread id = 23 (expected 23)
[2023-11-07T23:35:32.181Z]   (1) OK class VThreadStackRefTest$VThreadUnmountedJNIReferenced: ref count = 0 (expected 0), thread id = 0 (expected 0)
[2023-11-07T23:35:32.181Z]   (2) OK class VThreadStackRefTest$VThreadMountedReferenced: ref count = 1 (expected 1), thread id = 27 (expected 27)
[2023-11-07T23:35:32.181Z]   (3) ERROR class VThreadStackRefTest$VThreadMountedJNIReferenced: ref count = 1 (expected 1), thread id = 0 (expected 27)
[2023-11-07T23:35:32.181Z]   (4) OK class VThreadStackRefTest$PThreadReferenced: ref count = 1 (expected 1), thread id = 28 (expected 28)
[2023-11-07T23:35:32.181Z]   (5) OK class VThreadStackRefTest$VThreadUnmountedEnded: ref count = 0 (expected 0), thread id = 0 (expected 0)
[2023-11-07T23:35:32.181Z] STDERR:
[2023-11-07T23:35:32.181Z] java.lang.RuntimeException: Test failed
[2023-11-07T23:35:32.181Z]  at VThreadStackRefTest.main(VThreadStackRefTest.java:192)
[2023-11-07T23:35:32.181Z]  at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[2023-11-07T23:35:32.181Z]  at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[2023-11-07T23:35:32.181Z]  at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
[2023-11-07T23:35:32.181Z]  at java.base/java.lang.Thread.run(Thread.java:1595)
[2023-11-07T23:35:32.181Z] 
[2023-11-07T23:35:32.181Z] JavaTest Message: Test threw exception: java.lang.RuntimeException: Test failed

[2023-11-07T23:35:32.182Z] TEST: serviceability/jvmti/vthread/FollowReferences/VThreadStackRefTest.java#no-vmcontinuations

[2023-11-07T23:35:32.182Z] Stack local: index = 0, thread_id = 23
[2023-11-07T23:35:32.182Z]   (0) OK class VThreadStackRefTest$VThreadUnmountedReferenced: ref count = 1 (expected 1), thread id = 23 (expected 23)
[2023-11-07T23:35:32.182Z]   (1) OK class VThreadStackRefTest$VThreadUnmountedJNIReferenced: ref count = 0 (expected 0), thread id = 0 (expected 0)
[2023-11-07T23:35:32.182Z]   (2) OK class VThreadStackRefTest$VThreadMountedReferenced: ref count = 1 (expected 1), thread id = 29 (expected 29)
[2023-11-07T23:35:32.182Z]   (3) ERROR class VThreadStackRefTest$VThreadMountedJNIReferenced: ref count = 1 (expected 1), thread id = 0 (expected 29)
[2023-11-07T23:35:32.182Z]   (4) OK class VThreadStackRefTest$PThreadReferenced: ref count = 1 (expected 1), thread id = 30 (expected 30)
[2023-11-07T23:35:32.182Z]   (5) OK class VThreadStackRefTest$VThreadUnmountedEnded: ref count = 0 (expected 0), thread id = 0 (expected 0)
[2023-11-07T23:35:32.182Z] STDERR:
[2023-11-07T23:35:32.182Z] java.lang.RuntimeException: Test failed
[2023-11-07T23:35:32.182Z]  at VThreadStackRefTest.main(VThreadStackRefTest.java:192)
[2023-11-07T23:35:32.182Z]  at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[2023-11-07T23:35:32.182Z]  at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[2023-11-07T23:35:32.183Z]  at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
[2023-11-07T23:35:32.183Z]  at java.base/java.lang.Thread.run(Thread.java:1595)
[2023-11-07T23:35:32.183Z] 
[2023-11-07T23:35:32.183Z] JavaTest Message: Test threw exception: java.lang.RuntimeException: Test failed

[2023-11-07T23:35:32.183Z] TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Test failed
[2023-11-07T23:35:32.183Z] --------------------------------------------------
[2023-11-07T23:36:31.171Z] Test results: passed: 153; failed: 2
[2023-11-07T23:36:34.748Z] Report written to /home/jenkins/workspace/Test_openjdk21_j9_extended.openjdk_x86-64_linux/jvmtest/openjdk/report/html/report.html
[2023-11-07T23:36:34.748Z] Results written to /home/jenkins/workspace/Test_openjdk21_j9_extended.openjdk_x86-64_linux/aqa-tests/TKG/output_16993997562927/serviceability_jvmti_j9_0/work
[2023-11-07T23:36:34.748Z] Error: Some tests failed or other problems occurred.
[2023-11-07T23:36:34.748Z] -----------------------------------
[2023-11-07T23:36:34.748Z] serviceability_jvmti_j9_0_FAILED

50x internal grinder - all failed

JDK21 ppc64le_linux JDK21 x86-64_mac

fengxue-IS commented 10 months ago

Cause of this failure is #18394, the code jvmtiHeapFollowRefs_getStackData depends on iteratorData->referrer to set to proper value in e->refInfo.jni_local.thread_id. while the fix in #18394 fixed issue where internal pointer in referrer field may be exposed to user code, it also removed ways to trace back to the thread that hold the JNI local.

This is not a regression but legacy issue with OpenJ9's impl of reference chain walker. moving this issue out of 0.42. This should be fixed as part of #18416

pshipton commented 10 months ago

@fengxue-IS there isn't much point moving it to 0.43, it has almost the same time frame as 0.42. Moving it to 0.44.

pshipton commented 8 months ago

@fengxue-IS @babsingh these tests should be excluded so they are not failing in every build. serviceability/jvmti/vthread/FollowReferences/VThreadStackRefTest.java#default serviceability/jvmti/vthread/FollowReferences/VThreadStackRefTest.java#no-vmcontinuations

babsingh commented 8 months ago

these tests should be excluded so they are not failing in every build.

Opened https://github.com/adoptium/aqa-tests/pull/4937 to exclude the test.

Backports

babsingh commented 3 months ago

@fengxue-IS What's the update on https://github.com/eclipse-openj9/openj9/issues/18416? Since this is a legacy issue, it doesn't block the current release. Do you agree on moving this issue to the 0.48 release?

fengxue-IS commented 3 months ago

@fengxue-IS What's the update on #18416? Since this is a legacy issue, it doesn't block the current release. Do you agree on moving this issue to the 0.48 release?

There was a prototype completed #18864, but the initial testing was flaky, so kept deferring until the test becomes stable. This doesn't affect anything in the current release, I agree we can move it to 0.48