-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8348631: Crash in PredictedCallGenerator::generate after JDK-8347006 #23331
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 thartmann! A progress list of the required criteria for merging this PR into |
|
@TobiHartmann 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 8 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
|
@TobiHartmann The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
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 the offline explanation about how you found the failing bailout cases you need to catch: you just hard-coded the bailout for all such intrinsics, and ran testing. I think that should be sufficient for now.
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.
General question: how in other part of VM (runtime, gc) layout helper was changed for JDK-8297933?
| Node* cast = _gvn.transform(new CastPPNode(is_array_ctrl, *obj, TypeAryPtr::BOTTOM)); | ||
| if (!cast->is_top()) { | ||
| *obj = cast; | ||
| } |
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.
Add comment why it could be TOP.
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 added a comment.
|
I tested these changes against the original issue that prompted JDK-8348631, and everything looks good. Thanks for the quick fix! |
|
Thanks for the reviews Emanuel and Vladimir!
@vnkozlov The layout helper was not changed but IIUC (@rwestrel, please correct me if I'm wrong), the type system has now enough information about interfaces that it can determine that casting an object implementing an interface to an array must be TOP. However, the layout helper check is not folded.
@cushon Thanks for checking! |
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.
Good
|
Thanks again, Vladimir! |
|
/integrate |
|
Going to push as commit 55c3e78.
Your commit was automatically rebased without conflicts. |
|
@TobiHartmann Pushed as commit 55c3e78. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
|
/backport :jdk24 |
|
@TobiHartmann the backport was successfully created on the branch backport-TobiHartmann-55c3e78f-jdk24 in my personal fork of openjdk/jdk. To create a pull request with this backport targeting openjdk/jdk:jdk24, just click the following link: The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:
If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk: |
We crash / assert during C2 compilation of intrinsics like
_getLengthbecause the cast emitted by the array guard added by JDK-8347006 is folded to top:jdk/src/hotspot/share/opto/library_call.cpp
Lines 4302 to 4305 in c33c1cf
This happens when C2's type system determines that the type of the object that we cast implements an interface other than
SerializableorCloneableand therefore can't be an array. This is possible since JDK-8297933. Now unfortunately, control via the layout helper check is not (yet) folded due to:jdk/src/hotspot/share/opto/memnode.cpp
Lines 2215 to 2223 in c33c1cf
This is probably an oversight from JDK-8297933. Given that this is a regression in JDK 24, I'm going with a conservative approach of simply checking the cast for top and not using it if that's the case. In addition, I made the code more robust and added a compilation bailout (assert in debug) if an intrinsic produces a
topresult.We should then properly fix this by making sure that the layout helper check is folded. I filed JDK-8348853 for this.
Big thanks to @cushon for reporting this just in time for fixing in JDK 24!
Best regards,
Tobias
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23331/head:pull/23331$ git checkout pull/23331Update a local copy of the PR:
$ git checkout pull/23331$ git pull https://git.openjdk.org/jdk.git pull/23331/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23331View PR using the GUI difftool:
$ git pr show -t 23331Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23331.diff
Using Webrev
Link to Webrev Comment