-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8305672: Surprising definite assignment error after JDK-8043179 #13366
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 archiecobbs! A progress list of the required criteria for merging this PR into |
|
@archiecobbs The following label 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 list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
|
I'm not a Reviewer, but this looks good to me. I confirmed this fixes the original issue that I minimized for JDK-8305672. |
|
Could any Reviewer from compiler-dev@ review this change? We run large-scale tests against recent OpenJDK commits with our internal workload. This bug has caused several failures and blocked us from updating to the latest OpenJDK tip. |
I'd like to second this request. This bug was exposed very recently (by another bug fix), so it's never been part of any JDK release. It would be nice to keep it that way. Thanks. |
|
We just ran into this bug trying to compile JavaFX 21 with JDK 21. I raised the priority of the bug to P2, since this is a serious regression with no obvious workaround. @vicente-romero-oracle since you reviewed and sponsored the fix for JDK-8043179 in PR #10381 would you be able to review this? |
kevinrushforth
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.
I don't know this code area at all (and am not a jdk Reviewer), but I can confirm that this PR fixes the bug for me. After applying this patch and building a local JDK, I am able to compile JavaFX again.
|
the fix looks good to me, running regression tests now to make sure nothing breaks, will approve if all green |
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.
Looks good to me.
vicente-romero-oracle
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.
looks good
|
@archiecobbs 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 89 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. 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 (@vicente-romero-oracle) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
Thanks for the review @vicente-romero-oracle ! /integrate |
|
@archiecobbs |
|
/sponsor |
|
Going to push as commit d437c61.
Your commit was automatically rebased without conflicts. |
|
@vicente-romero-oracle @archiecobbs Pushed as commit d437c61. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
sure thanks @kevinrushforth and @neil too |
The fix for JDK-8043179 is to clear the DU flags for all variables when entering a lamba. This reflects the fact that the lamba's actual execution could be arbitrarily far in the future, so we can't assume anything that is DU when the lambda is created is still DU when the lambda actually executes.
However, this fix created a new bug. The problem is that
visitLambda()does not save & restore theuninitsTrybits, which are used byvisitTry()to track DU variables withintry { }blocks. So if there is atry { }block outside the lambda and atry { }block inside the lambda, the latter can "leak" DU state up to the former via this field. As a result, a final variable that should still be DU at the completion of the outertry { }block can be incorrectly recorded as not DU, leading to the bogus "might already have been assigned" error.This patch fixes that by adding the necessary save & restore logic.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13366/head:pull/13366$ git checkout pull/13366Update a local copy of the PR:
$ git checkout pull/13366$ git pull https://git.openjdk.org/jdk.git pull/13366/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13366View PR using the GUI difftool:
$ git pr show -t 13366Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13366.diff
Webrev
Link to Webrev Comment