-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8370502: C2: segfault while adding node to IGVN worklist #28432
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
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back krk! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
/issue 8370502 |
|
@krk The issue |
|
/issue JDK-8370502 |
|
@krk The issue |
Webrevs
|
mhaessig
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.
Thank you for working on this, @krk. And nice job reducing the test further!
I have a few questions and style comments below.
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 indentation in Java files should be 4 spaces.
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 followed another test's format style. Now I can see that there is a mixture of 2 and 4 space Test*.java files.
Fixing.
| void PhaseMacroExpand::expand_unlock_node(UnlockNode *unlock) { | ||
|
|
||
| Node* ctrl = unlock->in(TypeFunc::Control); | ||
| Node* mem = unlock->in(TypeFunc::Memory); |
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 I understand correctly, that mem is never nullptr because UnlockNode is a subclass of a SafepointNode which always has a memory input?
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.
UnlockNode is created at
jdk/src/hotspot/share/opto/graphKit.cpp
Line 3542 in b3acc48
| unlock->init_req( TypeFunc::Memory , memory(raw_idx) ); |
GraphKit:memory if memory is somehow null.
| transform_later(mem_phi); | ||
|
|
||
| _igvn.replace_node(_callprojs.fallthrough_memproj, mem_phi); | ||
| if (_callprojs.fallthrough_memproj != nullptr) { |
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.
Why do we not have to hook up the memory input to the fall through projection if it does not exist in the first place?
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.
Could you clarify the question?
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 code before assumed that fallthrough_memproj is always not null. So does the rest of the code also expect this? If so, then we should perhaps use mem for that purpose. This is related to @dean-long's question below. There is an invariant that is being violated and your fix should take into account why it is violated.
Co-authored-by: Manuel Hässig <[email protected]>
Co-authored-by: Manuel Hässig <[email protected]>
|
Why is fallthrough_memproj null, and why is this an issue only for expand_unlock_node but not expand_lock_node or other code that tries to replace fallthrough_memproj? |
|
|
||
| package compiler.c2; | ||
|
|
||
| public class Test8370502 { |
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.
Drive-by comment: Please rename the test to something more descriptive. We don't use bug numbers for test names anymore.
|
Also, +1 to Dean's question. We need a better understanding of how we ended up in this situation. |
Do not try to replace
fallthrough_memprojwhen it is null, fixes crash.Test case is simplified from the ticket. Verified that the case crashes without the fix.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28432/head:pull/28432$ git checkout pull/28432Update a local copy of the PR:
$ git checkout pull/28432$ git pull https://git.openjdk.org/jdk.git pull/28432/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28432View PR using the GUI difftool:
$ git pr show -t 28432Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28432.diff
Using Webrev
Link to Webrev Comment