-
Notifications
You must be signed in to change notification settings - Fork 721
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
Enable VirtualThread natives by default #15704
Conversation
I tested that the virtual thread natives are being run |
d678473
to
55234a9
Compare
jenkins test sanity xlinux jdk11,jdk19 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Will merge after the builds pass.
There is a segfault. @EricYangIBM Can you check if it is related to this PR?
|
The exception is from https://github.com/ibmruntimes/openj9-openjdk-jdk19/blob/3b112d4e1c05e85584248cda15d4c3c3c4c1d6be/src/java.base/share/classes/java/util/concurrent/atomic/Striped64.java#L388-L389 CELLSBUSY = l1.findVarHandle(Striped64.class,
"cellsBusy", int.class);
|
The problem is the segfault from native code. If the failure is introduced due to the changes from this PR, then we will have to rework these changes. Launched a grinder: https://openj9-jenkins.osuosl.org/job/Grinder/1247/. The failure occurs consistently. |
Isn't the crash from |
Generally, the VM should not crash for an exception. The new code in this PR is causing the VirtualThread class to be loaded. This leads to the evaluation of the static fields: |
It is crashing because in |
Fixing Since the VirtualThread class init can fail at this location in some cases ( |
Ref: ibmruntimes/openj9-openjdk-jdk19#18 (comment) openj9/runtime/jcl/common/thread.cpp Lines 619 to 623 in 92da2c6
Here,
I would even add an assert if the field is not found. If the Java code ever changes, the assertion will inform us to take action and update our implementation. |
Wouldn't that be too late since a jvmti agent can be attached by then? |
No. The field is only used within the VirtualThread class. It should be set before any VirtualThread instances are created. The static block for |
55234a9
to
37a99fd
Compare
The VirtualThread natives are needed to keep a list of every live virtual thread for JVM TI. Since JVM TI agents can be attached at any time, enable these natives by default. Issue: eclipse-openj9#15183 Signed-off-by: Eric Yang <eric.yang@ibm.com>
37a99fd
to
1fcfe29
Compare
jenkins test sanity win jdk19 |
Previous failures in xlinux passing: https://hyc-runtimes-jenkins.swg-devops.com/view/OpenJ9%20-%20Personal/job/Pipeline-Build-Test-Personal/13841/ |
It seems problematic to me that we have two implementations of |
re #15704 (comment): @keithc-ca I will verify if we can reuse the extension repo implementation of @EricYangIBM Which version of |
It seems our version of #15717 fixes the signatures of the We will need to set |
Note: |
No, in the extensions repositories, |
Could we hide their version of registerNatives in the same way? Just as a short term fix for the duplication. |
My suggestion is that we remove our version in favour of theirs and move the mount/unmount implementations into the related JVM_VirtualThread* functions (that now have the proper signatures). |
The problem is that we currently do not have a better place to set |
Few other problems: Moving code from |
In my view, our current approach has more potential problems than what I'm proposing. |
Perhaps the best answer for now is to modify |
I am not against these changes. I have prototyped them earlier this week. I have opened a PR: #15755.
The linkage error is seen after the code is moved from
A potential future issue, which does not immediately impact us. A number of PRs are open where
You are correct. But, we have used this approach as a workaround in the past for a similar case. openj9/runtime/jcl/common/sun_misc_Unsafe.cpp Lines 192 to 207 in 984612f
This was the initial approach: ibmruntimes/openj9-openjdk-jdk19#18. |
See comments at the end of eclipse-openj9#15704 for more details. Converted javanextvmi.c to a CPP file for including VMHelpers.hpp. Depends on ibmruntimes/openj9-openjdk-jdk19#23. Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
The VirtualThread natives are needed to keep a list of every live virtual
thread for JVM TI. Since JVM TI agents can be attached at any time, enable
these natives by default.
Issue: #15183
Signed-off-by: Eric Yang eric.yang@ibm.com