-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8365192: post_meth_exit should be in vm state when calling get_jvmti_thread_state #27112
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
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back lmesnik! A progress list of the required criteria for merging this PR into |
@lmesnik This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 43 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
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.
I've taken a first pass through and the code reorg seems okay. It would have been a little clearer without factoring out the transition method.
Thanks
// At this point we only have the address of a "raw result" and | ||
// we just call into the interpreter to convert this into a jvalue. | ||
// The post_method_exit_transition always makes transition to vm and back | ||
// where GC can happen. So it is needed to preserve result and then restore it |
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.
// where GC can happen. So it is needed to preserve result and then restore it | |
// where GC can happen. So it is needed to preserve result and then restore it |
} | ||
BasicType type = current_frame.interpreter_frame_result(&oop_result, &value); | ||
assert(type == T_VOID || current_frame.interpreter_frame_expression_stack_size() > 0, | ||
"Stack shouldn't be empty"); |
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.
I think this assertion needs an adaptation. The expression stack can be empty for native method calls. The result does not necessarily need to be on the expression stack depending on the platform.
Or what else is the reason it is expected to be non-empty?
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.
Thanks for adding the native check! Looks good to me, now.
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.
Thanks that looks clearer to me now.
One pre-existing typo.
} | ||
JRT_BLOCK_END | ||
if (interp_only) { | ||
// The JRT_BLOCK_END can safepoint in ThreadInVMfromJava desctructor. Now it is safe to allow |
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.
// The JRT_BLOCK_END can safepoint in ThreadInVMfromJava desctructor. Now it is safe to allow | |
// The JRT_BLOCK_END can safepoint in ThreadInVMfromJava destructor. Now it is safe to allow |
This is the second attempt to fix method
post_meth_exit
to correctly set state and preserve result.The related fix here:
b7b64bb
Hope fix became clarere now.
There 2 problems in this post_meth_exit:
state->is_enabled(JVMTI_EVENT_METHOD_EXIT)
however transition in the JRT_BLOCK_END happens always. So there is a risk of loosing method results in the interp_only mode.get_jvmti_thread_state
should be called when thread is in vm state only.The fix adds
post_method_exit_transition
to have single exit point with oop restoration.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27112/head:pull/27112
$ git checkout pull/27112
Update a local copy of the PR:
$ git checkout pull/27112
$ git pull https://git.openjdk.org/jdk.git pull/27112/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27112
View PR using the GUI difftool:
$ git pr show -t 27112
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27112.diff
Using Webrev
Link to Webrev Comment