-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) #27913
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 aseoane! A progress list of the required criteria for merging this PR into |
|
@anton-seoane 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 70 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@robcasloz, @mgronlun, @dean-long) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
@anton-seoane The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
|
/cc hotspot-jfr |
|
@robcasloz |
|
Switching back to draft after conversation with @robcasloz, to perform further investigation |
|
|
|
@anton-seoane |
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.
test/hotspot/jtreg/compiler/intrinsics/TestReturnOopSetForJFRWriteCheckpoint.java
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java
Outdated
Show resolved
Hide resolved
| * @test | ||
| * @summary Tests that the getEventWriter call to write_checkpoint correctly | ||
| * reports returning an oop | ||
| * @requires vm.hasJFR & vm.continuations |
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.
Do we need vm.continuations?
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.
We don't. Removed the requirement
| * reports returning an oop | ||
| * @requires vm.hasJFR & vm.continuations | ||
| * @library /test/lib / | ||
| * @modules jdk.jfr/jdk.jfr.internal |
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.
Do we need this?
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.
We don't. Removed as well!
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.
(Referring to line 38 only).
test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/intrinsics/TestReturnsOopSetForJFRWriteCheckpoint.java
Show resolved
Hide resolved
Co-authored-by: Roberto Castañeda Lozano <[email protected]>
…WriteCheckpoint.java Co-authored-by: Roberto Castañeda Lozano <[email protected]>
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! Please test the latest changes, at least through some low tiers, before integration.
|
Reverted the more precise IR Framework check that @robcasloz suggested as the method where the actual call to |
| TestFramework.run(); | ||
| } | ||
|
|
||
| // Crash was due to the returns_oop field not being set |
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 was confused when I could not find "returns_oop". It turns out the names are CallNode::returns_pointer() and ScopeDesc::return_oop().
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.
Oh, I got them mixed up. I will update things accordingly, thanks!
| // Please ensure the return type of the runtime call matches its signature, | ||
| // even if the return value is unused. This is crucial for correct handling | ||
| // of runtime calls that return an oop and may trigger deoptimization | ||
| // on return. See rematerialize_objects() in deoptimization.cpp. |
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 was wondering why this is only a problem for deoptimization, and not regular safepoints that trigger a GC. But the comment in rematerialize_objects() explains that the return value is not part of the GC oopmap.
| * @bug 8347463 | ||
| * @requires vm.hasJFR | ||
| * @library /test/lib / | ||
| * @run driver compiler.intrinsics.TestReturnsOopSetForJFRWriteCheckpoint |
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.
You will have to update this line as well after the class name change.
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.
Oh, right. My bad. Fixed
|
Thanks to all for the reviews and suggestions! |
|
/integrate |
|
@anton-seoane |
|
/sponsor |
|
Going to push as commit 8457f38.
Your commit was automatically rebased without conflicts. |
|
@robcasloz @anton-seoane Pushed as commit 8457f38. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing.
The
inline_native_GetEventWriterJFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (jobject) that then gets resolved to a raw oop.However, the corresponding
jfr_write_checkpoint_Typedoes not set any return, modelling the call asvoid. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash.An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (
runtime.hpp) is added to hopefully prevent similar cases in the future.Testing: passes tiers 1-5
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913$ git checkout pull/27913Update a local copy of the PR:
$ git checkout pull/27913$ git pull https://git.openjdk.org/jdk.git pull/27913/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27913View PR using the GUI difftool:
$ git pr show -t 27913Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27913.diff
Using Webrev
Link to Webrev Comment