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

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 this issue Nov 9, 2023 · 6 comments

Comments

@JasonFengJ9
Copy link
Member

JasonFengJ9 commented Nov 9, 2023

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
Copy link
Contributor

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
Copy link
Member

@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
Copy link
Member

@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 added a commit to babsingh/aqa-tests that referenced this issue Dec 29, 2023
Related: eclipse-openj9/openj9#18426

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
@babsingh
Copy link
Contributor

babsingh commented Dec 29, 2023

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

Opened adoptium/aqa-tests#4937 to exclude the test.

Backports

pshipton pushed a commit to adoptium/aqa-tests that referenced this issue Dec 29, 2023
Related: eclipse-openj9/openj9#18426

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
babsingh added a commit to babsingh/aqa-tests that referenced this issue Dec 29, 2023
Related: eclipse-openj9/openj9#18426

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
babsingh added a commit to babsingh/aqa-tests that referenced this issue Dec 29, 2023
Related: eclipse-openj9/openj9#18426

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
llxia pushed a commit to adoptium/aqa-tests that referenced this issue Dec 29, 2023
Related: eclipse-openj9/openj9#18426

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
llxia pushed a commit to adoptium/aqa-tests that referenced this issue Dec 29, 2023
Related: eclipse-openj9/openj9#18426

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
@babsingh
Copy link
Contributor

@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?

@fengxue-IS
Copy link
Contributor

@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

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

5 participants