-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8360031: C2 compilation asserts in MemBarNode::remove #26556
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 dfenacci! A progress list of the required criteria for merging this PR into |
|
@dafedafe 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 869 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 |
|
@shipilev you might want to have a look. Thanks! |
Webrevs
|
shipilev
left a comment
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 looks reasonable to me. So it looks to be an overly zealous assert rather than compiler bug? Someone more savvy with C2 code need to look and confirm.
/reviewers 2
|
Oh, maybe pull from the recent master to get GHA fixes, and other fixes? |
|
Hi! Wanted to mention this might be related to the following: JDK-8330062, which I'm giving a look at the moment |
|
This look OK on the surface, but isn't handling MemBarStoreStore and MemBarRelease differently asking for trouble? Is there a reason why they need to be handled in different passes? |
I'm not sure of the reason why EA handles BTW the original assert with condition |
|
I stepped through the crash with the replay file, and I'm not convinced that the problem is only with MemBarStoreStore and not MemBarRelease. What happens in the replay crash is the MemBarStoreStore gets onto the worklist through an indirect route in ConnectionGraph::split_unique_types() because of its memory edge. I think this explains why it is intermittent and hard to reproduce. A MemBarRelease on the other hand would get added to the worklist directly in compute_escape() if it has a Precedent edge. |
…ysis/adapt remove assert
Oh I see! Thanks @dean-long! I noticed that
I made |
| } | ||
|
|
||
| void MemBarNode::remove(PhaseIterGVN *igvn) { | ||
| if (outcnt() != 2) { |
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.
By itself, this allows outcnt() == 0, so maybe we need to continue to fail if that happens.
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 the condition to the assert.
|
The fix made the |
dean-long
left a comment
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.
LGTM, but let's wait for @vnkozlov to approve it.
|
@dafedafe This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
vnkozlov
left a comment
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, looks good. Thank you @dean-long for suggestions and @dafedafe implementation. I agree with this.
|
Thanks a lot for your reviews @dean-long @shipilev @vnkozlov! |
|
/integrate |
|
Going to push as commit 991f8e6.
Your commit was automatically rebased without conflicts. |
Issue
While compiling
java.util.zip.ZipFilein C2 this assert is triggeredjdk/src/hotspot/share/opto/memnode.cpp
Line 4235 in a2e86ff
Cause
While compiling the constructor of java.util.zip.ZipFile$CleanableResource the following happens:
MemBarStoreStorein the constructorMemBarStoreStorenode. The node still has a control output attached.MemBarStoreStorenode is handled and we try to remove it (because theAllocatenode of theMembBaris not escaping the thread )jdk/src/hotspot/share/opto/memnode.cpp
Lines 4301 to 4302 in 7b7136b
jdk/src/hotspot/share/opto/memnode.cpp
Line 4235 in 7b7136b
triggers because the barrier has only 1 (control) output and is a
MemBarStoreStore(notInitialize) barrierThe issue happens only when the
UseStoreStoreForCtoris set (default as well), which makes C2 useMemBarStoreStoreinstead ofMemBarReleaseat the end of constructors.MemBarStoreStoreare processed separately by EA and this happens after the IGVN pass that folds the memory subtree.MemBarReleaseon the other hand are handled during same IGVN pass before the memory subtree gets removed and it’s still got 2 outputs (assert skipped).Fix
Adapting the assert to accept that
MemBarStoreStorecan also have!= 2outputs (when+UseStoreStoreForCtoris used) seems to be an OK solution as this seems like a perfectly plausible situation.Testing
Unfortunately reproducing the issue with a simple regression test has proven very hard. The test seems to rely on very peculiar profiling and IGVN worklist sequence. JBS replay compilation passes. Running JCK's
api/java_util100 times triggers the assert a couple of times on average before the fix, none after.Tier 1-3+ tests passed.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26556/head:pull/26556$ git checkout pull/26556Update a local copy of the PR:
$ git checkout pull/26556$ git pull https://git.openjdk.org/jdk.git pull/26556/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26556View PR using the GUI difftool:
$ git pr show -t 26556Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26556.diff
Using Webrev
Link to Webrev Comment