Skip to content
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

8255448: Fastdebug JVM crashes with Vector API when PrintAssembly is turned on #853

Closed
wants to merge 4 commits into from

Conversation

dongbohe
Copy link
Member

@dongbohe dongbohe commented Oct 25, 2020

8255448: Fastdebug JVM crashes with Vector API when PrintAssembly is turned on


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8255448: Fastdebug JVM crashes with Vector API when PrintAssembly is turned on

Reviewers

Contributors

  • Huang Wang <wanghuang3@huawei.com>

Download

$ git fetch https://git.openjdk.java.net/jdk pull/853/head:pull/853
$ git checkout pull/853

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 25, 2020

👋 Welcome back dongbohe! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

@openjdk openjdk bot commented Oct 25, 2020

@dongbohe The following label will be automatically applied to this pull request:

  • hotspot-compiler

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.

@openjdk openjdk bot added hotspot-compiler rfr labels Oct 25, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 25, 2020

Webrevs

@dongbohe
Copy link
Member Author

@dongbohe dongbohe commented Oct 25, 2020

/contributor add Huang Wang wanghuang3@huawei.com

@openjdk
Copy link

@openjdk openjdk bot commented Oct 25, 2020

@dongbohe
Contributor Huang Wang <wanghuang3@huawei.com> successfully added.

@TobiHartmann
Copy link
Member

@TobiHartmann TobiHartmann commented Oct 26, 2020

We shouldn't do "backports" from project specific issues to mainline. Please file a separate issue for this. Thanks!

@@ -489,6 +489,7 @@ void JVMState::format(PhaseRegAlloc *regalloc, const Node *n, outputStream* st)
ciField* cifield;
if (iklass != NULL) {
st->print(" [");
iklass->nof_nonstatic_fields(); // FIXME: iklass->_nonstatic_fields == NULL

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was intended as a quick hack and JVMState::format() is not the right place to solve the problem.
I suggest to look at PhaseVector::scalarize_vbox_node.

Here are some pointers on how it is done in other places:
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/macro.cpp#L740
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/memnode.cpp#L1320

@dongbohe dongbohe changed the title 8253623: Fastdebug JVM crashes with Vector API when PrintAssembly is turned on 8255448: Fastdebug JVM crashes with Vector API when PrintAssembly is turned on Nov 13, 2020
@dongbohe
Copy link
Member Author

@dongbohe dongbohe commented Nov 13, 2020

/test

@openjdk
Copy link

@openjdk openjdk bot commented Nov 13, 2020

@dongbohe you need to get approval to run the tests in tier1 for commits up until 12318bd

@openjdk openjdk bot added the test-request label Nov 13, 2020
@@ -242,11 +242,19 @@ void PhaseVector::scalarize_vbox_node(VectorBoxNode* vec_box) {
SafePointNode* sfpt = safepoints.pop()->as_SafePoint();

uint first_ind = (sfpt->req() - sfpt->jvms()->scloff());
ciKlass* cik = vec_box->box_type()->is_oopptr()->klass();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better, thanks!

I suggest to simplify it as follows:

diff --git a/src/hotspot/share/opto/vector.cpp b/src/hotspot/share/opto/vector.cpp
index 667ca0592e0..e194683be4a 100644
--- a/src/hotspot/share/opto/vector.cpp
+++ b/src/hotspot/share/opto/vector.cpp
@@ -244,12 +244,16 @@ void PhaseVector::scalarize_vbox_node(VectorBoxNode* vec_box) {
   while (safepoints.size() > 0) {
     SafePointNode* sfpt = safepoints.pop()->as_SafePoint();
 
+    ciInstanceKlass* iklass = vec_box->box_type()->klass()->as_instance_klass();
+    int n_fields = iklass->nof_nonstatic_fields();
+    assert(n_fields == 1, "sanity");
+
     uint first_ind = (sfpt->req() - sfpt->jvms()->scloff());
     Node* sobj = new SafePointScalarObjectNode(vec_box->box_type(),
 #ifdef ASSERT
                                                NULL,
 #endif // ASSERT
-                                               first_ind, /*n_fields=*/1);
+                                               first_ind, n_fields);
     sobj->init_req(0, C->root());
     sfpt->add_req(vec_value);

@dongbohe
Copy link
Member Author

@dongbohe dongbohe commented Nov 17, 2020

tier1 and tier2 passed

Copy link

@iwanowww iwanowww left a comment

Looks good.

@openjdk
Copy link

@openjdk openjdk bot commented Nov 17, 2020

@dongbohe 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:

8255448: Fastdebug JVM crashes with Vector API when PrintAssembly is turned on

Co-authored-by: Huang Wang <wanghuang3@huawei.com>
Reviewed-by: vlivanov

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 364 new commits pushed to the master branch:

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 (@iwanowww) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready label Nov 17, 2020
@dongbohe
Copy link
Member Author

@dongbohe dongbohe commented Nov 17, 2020

/integrate

@openjdk openjdk bot added the sponsor label Nov 17, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Nov 17, 2020

@dongbohe
Your change (at version e72ffde) is now ready to be sponsored by a Committer.

@dongbohe
Copy link
Member Author

@dongbohe dongbohe commented Nov 17, 2020

/test

@openjdk
Copy link

@openjdk openjdk bot commented Nov 17, 2020

@dongbohe you need to get approval to run the tests in tier1 for commits up until e72ffde

@dongbohe
Copy link
Member Author

@dongbohe dongbohe commented Nov 18, 2020

We shouldn't do "backports" from project specific issues to mainline. Please file a separate issue for this. Thanks!

thank you! I have created a new issue https://bugs.openjdk.java.net/browse/JDK-8255448

@RealFYang
Copy link
Member

@RealFYang RealFYang commented Nov 18, 2020

/sponsor

@openjdk openjdk bot closed this Nov 18, 2020
@openjdk openjdk bot added integrated and removed sponsor ready rfr labels Nov 18, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Nov 18, 2020

@RealFYang @dongbohe Since your change was applied there have been 364 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit ef3ddb1.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

openjdk-notifier bot referenced this issue Nov 18, 2020
…turned on

Co-authored-by: Huang Wang <wanghuang3@huawei.com>
Reviewed-by: vlivanov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler integrated test-request
4 participants