-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8271055: Crash during deoptimization with "assert(bb->is_reachable()) failed: getting result from unreachable basicblock" with -XX:+VerifyStack #4902
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 yyang! A progress list of the required criteria for merging this PR into |
|
@kelthuzadx 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. |
|
/add hotspot-runtime |
|
@kelthuzadx Unknown command |
|
@kelthuzadx Unknown command |
|
/label add hotspot-runtime |
|
@kelthuzadx Unknown command |
|
@kelthuzadx |
|
@kelthuzadx |
|
@kelthuzadx |
Webrevs
|
|
|
TobiHartmann
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.
Just wondering, did you sync up with @chhagedorn who (still) has this assigned? Not sure if he already started working on it.
| // a given bytecode or the state after, so we try both | ||
| if (!Bytecodes::is_invoke(cur_code) && cur_code != Bytecodes::_athrow) { | ||
| // Get expression stack size for the next bytecode | ||
| if(UseNewCode) { |
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 assume you intended to remove this from the final version of the patch.
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.
Sorry... I haven't sync up with @chhagedorn, I picked up a starter issue to work on it and missed assignee. I will update my query condition to filter unassigned issue later.
|
Hi @kelthuzadx, please make sure to always have a JBS issue assigned to you before creating a PR for it. If the issue is already assigned you can do a sync with the assignee and ask to take it over. In this case, I have not started working on it, yet, so you can take it over and reopen the PR again. |
|
Thank you @chhagedorn! I will take care of this later. |
|
P.S. In summary, I think there are two bugs: one for javac, one for VM. -- Javac side: I'm not good at this area, hope to have more experts' comments. --- VM side: It crashes with the same assertion: After applying this patch, it works. pre-submit tests failed due to change about javac. I will fix them if changes involving javac in this PR is reviewed. |
|
HotSpot and javac should be fixed independently, please file a new bug for javac. Regarding the change to The fix looks reasonable to me but someone from runtime who knows that code better should have a look. |
Hi Tobias, It's not sufficient to fix this bug without javac changes. But it reveals another crash that I posted above. Maybe I should file a new issue for that and fix it? Later when javac bug is solved, this bug can also be set to resolve. |
|
Okay but then the fix is incomplete because the VM also needs to handle bytecode not generated by javac. Other compilers or hand written bytecode might still miss these traps.Of course, if the bytecode violates the Spec, the verifier should catch this but otherwise the VM should not crash or assert.
I think it's just a different failure mode and should be fixed with this bug.
No, as explained above, other compilers could still generate this bytecode shape. We need to handle it properly in the VM. |
Make sense! I will prepare a more proper fix to solve this even without javac change. (But it may take a while since I'm busy on other stuffs now...) |
|
@kelthuzadx 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 add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Hi, I'm trying to fix JDK-8271055. The root cause is that some basic blocks are not interpreted because there is no trap bytecode inside them, these basic blocks eventually become unreachable and lead to a crash. Maybe we need to coordinate compiler and hotspot groups to fix this crash.
The attached test generates the following bytecode:
Javac generates some unreachable basic blocks(BCI 14 - 28), and there is no exception table for them, VM knows nothing about them. I found the same bug report at JDK-8022186 which was marked as
Fixed, but I think it was not properly fixed, In some similar cases, javac cannot work well, I have filed https://bugs.openjdk.java.net/browse/JDK-8271254 for another javac bug.Going back to this bug, the proposed change is to insert a nop in empty try-block so that javac can generate the correct exception table. Now generated bytecodes look like this:
However, this is not the end. Even if the exception table is correctly generated, VM only enters GenerateOopMap::do_exception_edge when the bytecode may be trapped. In order to setup handler block, we need to relax this restriction to allow even bytecodes such as nop to correctly enter GenerateOopMap::do_exception_edge. Otherwise, handler block will not be interpreted, its stack is problematic and finally hits the assertion.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4902/head:pull/4902$ git checkout pull/4902Update a local copy of the PR:
$ git checkout pull/4902$ git pull https://git.openjdk.java.net/jdk pull/4902/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4902View PR using the GUI difftool:
$ git pr show -t 4902Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4902.diff