-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8344935: [ubsan]: javaThread.hpp:1241:52: runtime error: load of value 9831830, which is not a valid value for type 'freeze_result' #22361
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
Conversation
👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into |
@MBaesken 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 183 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
|
Hi @MBaesken I don't think this fix will help. The real problem seems to be that Currently the setting is only ever done in From looking quickly I think there are (at least) 2 locations where setting
My suggestion would be to a add setting |
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 missing initializer is fine but note that as @reinrich stated in the JBS issue there is actually a bug here as we should have already set a reason if we are calling JVM_VirtualThreadPinnedEvent
. With your change we should now get an assertion failure.
EDIT: for some reason @reinrich 's comment was not showing up when I made mine. |
okay I can add setting the value with |
I don't think that's needed. Nice thing about initializing with It is easy to forget setting |
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.
Seems reasonable but I'm by no means a freeze/thaw expert. I'd really like @pchilano to review this but he won't be back until Monday 2nd December.
Thanks
/contributor add @reinrich |
@MBaesken |
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.
Looks good.
Thanks, Richard.
@pchilano whould you mind reviewing this small fix? |
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.
Looks good, thanks for fixing it.
if (UNLIKELY(res != freeze_ok)) { | ||
JFR_ONLY(current->set_last_freeze_fail_result(res);) |
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.
Note that we don’t need to save the result when unmounting from the VM, i.e the preempt case. We return it from Continuation::try_preempt()
so it is already available when we call post_vthread_pinned_event()
[1][2]. When unmounting from Java we do need to save it because the call to post_vthread_pinned_event()
will be done later in VirtualThread.postPinnedEvent()
, where the return value from the freeze call is not available anymore.
[1]
current->post_vthread_pinned_event(&vthread_pinned_event, "Contended monitor enter", result); |
[2]
jdk/src/hotspot/share/runtime/objectMonitor.cpp
Line 1824 in 30b8bbe
current->post_vthread_pinned_event(&vthread_pinned_event, "Object.wait", result); |
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 see. Thanks for making us aware.
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.
This is the complete diff when everything related to the preempt case is reverted again: reinrich/jdk@e29b0ed...ce3ddf6
@MBaesken could you please check and apply this commit to do the reverting reinrich@ce3ddf6 if you're ok with 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.
The JFR event support changed a bit near the end so looks like this slipped through. For the non-preempt cases, the _last_freeze_fail_XXX values must be set so that the later call to record an event has the last reason/time. So I think the change look good. I see the failure was in legacy mode so more likely to run into this.
Adjusted as suggested. |
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.
Looks good (test results too).
Thanks, Richard.
Thanks for the reviews ! /integrate |
Going to push as commit cf1eb58.
Your commit was automatically rebased without conflicts. |
Thanks for the reviews ! /integrate |
@MBaesken The command |
Seems we miss initialization of _last_freeze_fail_result in the JavaThread constructor, this should be added.
Causes otherwise ubsan issues in the test java/lang/Thread/virtual/MonitorEnterExit.java#Xcomp-TieredStopAtLevel1-LM_LEGACY
/priv/jenkins/client-home/workspace/openjdk-jdk-weekly-linux_x86_64-opt/jdk/src/hotspot/share/runtime/javaThread.hpp:1241:52: runtime error: load of value 9831830, which is not a valid value for type 'freeze_result'
#0 0x7f5edef378eb in JavaThread::last_freeze_fail_result() src/hotspot/share/runtime/javaThread.hpp:1241
#1 0x7f5edef378eb in JVM_VirtualThreadPinnedEvent src/hotspot/share/prims/jvm.cpp:3805
Progress
Issue
Reviewers
Contributors
<[email protected]>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22361/head:pull/22361
$ git checkout pull/22361
Update a local copy of the PR:
$ git checkout pull/22361
$ git pull https://git.openjdk.org/jdk.git pull/22361/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22361
View PR using the GUI difftool:
$ git pr show -t 22361
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22361.diff
Using Webrev
Link to Webrev Comment