Skip to content

[JDK19] JVMTI ContYieldBreakPointTest Fails #16215

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

Closed
babsingh opened this issue Oct 27, 2022 · 6 comments
Closed

[JDK19] JVMTI ContYieldBreakPointTest Fails #16215

babsingh opened this issue Oct 27, 2022 · 6 comments
Labels
Milestone

Comments

@babsingh
Copy link
Contributor

This test is related to Project Loom and passes with the RI.

Related: #16187.

Issue

  • Java_ContYieldBreakPointTest_enableEvents invokes jvmtiGetClassMethods and tries to find the yield0 method in the jdk.internal.vm.Continuation class.
  • But, yield0 does not exist in OpenJ9's implementation of the jdk.internal.vm.Continuation class.
  • We can either update the test or match our implementation of the jdk.internal.vm.Continuation class with the RI to resolve this failure.
  • Until then, this test cannot be supported with OpenJ9.
  • Related test code:
  err = jvmti->GetClassMethods(contKlass, &method_count, &methods);
  check_jvmti_status(jni, err, "enableEvents: error in JVMTI GetClassMethods");

  // Find jmethodID of Continuation.yield0()
  while (--method_count >= 0) {
    jmethodID meth = methods[method_count];
    char* mname = get_method_name(jvmti, jni, meth);

    if (strcmp(mname, "yield0") == 0) {
      LOG("enableEvents: found method %s() to set a breakpoint\n", mname);

      method = meth;
    }
    deallocate(jvmti, jni, (void*)mname);
  }
  if (method == NULL) {
    jni->FatalError("Error in enableEvents: not found method fibTest()");
  }

Test CMD

make test TEST="jtreg:test/hotspot/jtreg/serviceability/jvmti/vthread/ContYieldBreakPointTest/ContYieldBreakPointTest.java" JTREG="JAVA_OPTIONS=--enable-preview -Dvm.continuations=true;VERBOSE=all"

Test Output

STDOUT:
Agent_OnLoad started
Agent_OnLoad finished

######   main: started   #####


####  runTest: started  ####


####  yieldTest: started  ####


####  yieldTest: done warming up ####

enableEvents: started
STDERR:

Fatal error: Error in enableEvents: not found method fibTest()
@babsingh babsingh added this to the Java 19 milestone Oct 27, 2022
@babsingh
Copy link
Contributor Author

yield0 does not exist in OpenJ9's implementation of the jdk.internal.vm.Continuation class. We can either update the test or match our implementation of the jdk.internal.vm.Continuation class with the RI to resolve this failure.

RI's signature for yield0

    private boolean yield0(ContinuationScope scope, Continuation child) {

@fengxue-IS Let us know how shall we proceed. Tagged this failure under the current Java 19 milestone. If this test does not need to be supported, please change the milestone.

@babsingh babsingh changed the title [JDK19] JVMTI Serviceability ContYieldBreakPointTest Fails [JDK19] JVMTI ContYieldBreakPointTest Fails Oct 31, 2022
@pshipton pshipton added the jdk19 label Nov 1, 2022
@tajila tajila added the project:loom Used to track Project Loom related work label Nov 1, 2022
@fengxue-IS
Copy link
Contributor

OpenJ9 have a separate impl on how continuation is yielded due to the difference in native representation of a continuation. This test should be excluded for now and we can re-visit this when working on structured concurrency.

@babsingh
Copy link
Contributor Author

As per #16437 (comment), structured concurrency won't need more changes. @fengxue-IS Will it be easy and straightforward to match the RI: #16215 (comment)? The goal is to enable the test for JDK20 if feasible.

@babsingh
Copy link
Contributor Author

babsingh commented Feb 8, 2023

@fengxue-IS any updates on #16215 (comment)?

@fengxue-IS
Copy link
Contributor

I've tried a prototype #16693.
Test passed with this change in JDK19

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR   
   jtreg:test/hotspot/jtreg/serviceability/jvmti/vthread/ContYieldBreakPointTest/ContYieldBreakPointTest.java
                                                         1     1     0     0   
==============================
TEST SUCCESS

Given that this change doesn't offer any benefit other than passing this test, we should have a discussion on if this should be merged.

@babsingh
Copy link
Contributor Author

Closing, ContYieldBreakPointTest enabled in adoptium/aqa-tests#4550.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants