-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8263164: assert(_base >= VectorA && _base <= VectorZ) failed: Not a Vector while calling StoreVectorNode::memory_size() #2867
Conversation
/issue add JDK-8263164 |
👋 Welcome back jiefu! A progress list of the required criteria for merging this PR into |
…ector while calling StoreVectorNode::memory_size()
@DamonFool This issue is referenced in the PR title - it will now be updated. |
@DamonFool |
@DamonFool 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 don't think it is correct place to fix it. Why checks in StoreNode(and LoadNode)::Value() does not work for vectors?:
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/memnode.cpp#L2702
Did we forgot to put this nodes on IGVN worklist somewhere?
Hi @vnkozlov , Thanks for your review. After more investigation, I found the same issue for non-vector store nodes. The nodes should have been pushed on the IGVN worklist since it happened when StoreN was popped from the IGVN worklist. By the way, I'm not clear why you say the checks in StoreNode(and LoadNode)::Value() does not work for vectors? Best regards, |
What I mean is IGVN should replace nodes which have TOP input with TOP and remove them from graph as dead nodes. In case of memory nodes To my surprise Yes, your fix works for And we need to test it hard because it is very old code. |
Thanks @vnkozlov for your kind explanation. |
Hi @vnkozlov , Unfortunately, it doesn't work to avoid store->in(MemNode::ValueIn)->bottom_type() == Type::TOP by just improving StoreNode::Ideal(). TOP value seems hard to be avoided for store nodes during C2's optimization phase. And I suggest to keep StoreNode::Ideal() as it is to lower the risk. What do you think? Thanks. To show you how this can happen, please run vmTestbase/nsk/jdi/StepEvent/itself/stepEvent004/stepEvent004.java several times with the following change:
In my experiment, I got the failure like this
|
virtual int memory_size() const { return vect_type()->length_in_bytes(); } | ||
virtual int memory_size() const { | ||
if (in(MemNode::ValueIn)->bottom_type()->isa_vect() != NULL) { | ||
return vect_type()->length_in_bytes(); |
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 same issue also exists when method "vect_type()"
(line 757) is called directly, doesn't 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.
All codes that calles vect_type()
in StoreVectorNode
met the same issue. And I think it's better to make sure the in(MemNode::ValueIn)->bottom_type()
is a TypeVect
. We need to fix the issues that make it not the right type, doesn't 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.
Good catch!
Thanks @XiaohongGong for your review.
Yes, in theory, there may be the same bug when vect_type() is called since it's based on Type::is_vect().
However, by this reasoning, there might be the same bug in non-vector types such as Type::is_int()/Type::is_long()/Type::is_ptr()/... too.
Will do more investigation.
Thanks.
Would be nice to see where TOP value is coming from in stepEvent004.java test. |
Have you tried |
Okay, will do it. |
Thanks @theRealELiu for your review. I've tried this
But there is still no good news. |
/test |
@DamonFool you need to get approval to run the tests in tier1 for commits up until 9166bd1 |
/test |
@DamonFool you need to get approval to run the tests in tier1 for commits up until 311c976 |
Hi @vnkozlov , @XiaohongGong and @theRealELiu , If I read the code correctly, StoreNode::Idea can't fix this kind of bugs. This is because we may see other store nodes with value=top on the IGVN list [1]
Fixing in StoreNode::Idea can just bypass the top value for the current store node during IGVN optimization. So we should support vector's memory_size()/element_size()/length()/length_in_bytes() for that case. vect_type() has been improved based on @XiaohongGong 's comments. Testing:
Thanks. [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/memnode.cpp#L4467 |
Why not simply cache the vector type of value being stored during And that's the reason I don't understand why non- Nevertheless, there's another case that seems to suffer from the very same problem - |
Thanks @iwanowww for your review. Good suggestion! |
Hi @iwanowww ,
I didn't get your point why ReductionNode also suffers from the very same problem. Best regards, |
/test |
@DamonFool you need to get approval to run the tests in tier1 for commits up until fc9bdaf |
The following code experiences the very same problem, doesn't it?
|
Hi @iwanowww , Di you mean the following assert may fail for ReductionNode?
But it seems fine to pass a Type::TOP to it.
Am I missing something? Thanks. |
I thought that
|
OK, I got it. Fixed. |
/test |
@DamonFool you need to get approval to run the tests in tier1 for commits up until e2f70ac |
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, Jie. Looks good.
I'll submit it for testing.
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.
hs-precheckin-comp, hs-tier1, and hs-tier2 are clean.
@DamonFool 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 133 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 |
@DamonFool 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 127 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 |
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.
Yes, I agree with this version of fix.
Thanks @vnkozlov . And also thanks @XiaohongGong and @theRealELiu for your help. |
@DamonFool Since your change was applied there have been 133 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 5069796. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi all,
Several Vector API tests failed intermittently due to this assert.
The reason is that StoreVectorNode::memory_size() will fail if StoreVectorNode->in(MemNode::ValueIn)->bottom_type() == Type::TOP.
However, this case seems possible during C2's optimization.
And the same bug exists for LoadVectorNode::memory_size() as well.
The fix returns 0 if StoreVectorNode->in(MemNode::ValueIn)->bottom_type() is not a vector type.
Testing:
Any comments?
Thanks.
Best regards,
Jie
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/2867/head:pull/2867
$ git checkout pull/2867