-
Notifications
You must be signed in to change notification settings - Fork 457
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
[Port] Fix the incorrect merge logic for back edges for GlobalFlowStateAnalysis #6038
Conversation
Fixes dotnet#6015 `GlobalFlowStateAnalysisValueSet.Unset` is used to represent unanalyzed flow state, `GlobalFlowStateAnalysisValueSet.Empty` is used to represent analyzed flow state with no analysis values. We initialize the flow states for the entry basic block of the CFG with `Unset` value, but never replace the `Unset` with `Empty` for subsequent passes. This in turn leads to incorrect merge when a `Known` value flows from the back edge to the loop start and ends up overriding the `Unset` value instead of being overridden by the `Empty` value. Now we correctly perform this merge logic. I verified that prior to this fix, the added unit test hang due to this issue. I also verified that building the github repo cited in the feedback ticket with platform compat analyzer also leads to a hang before this fix. Both these repros are fixed after this PR.
@JoeRobich @jmarolf - seems like we need to port #6032 to release/6.0.4xx branch to fix the build errors about duplicate package references. |
Can those changes be merged into this branch/PR since otherwise they wouldn't need to be ported? |
Thanks @JoeRobich! |
Thanks @mavasani I have updated the description by the 6.0 servicing template, please check and updates as needed, especially the Risk part might need more update |
Thanks @buyaa-n - I believe your description is appropriate, we don't need further updates. |
@JoeRobich @jmarolf Do you know what is causing the build failures? Are we using the correct .NET SDK/compiler for the build?
|
Codecov Report
@@ Coverage Diff @@
## release/6.0.4xx #6038 +/- ##
================================================
Coverage 95.53% 95.53%
================================================
Files 1275 1275
Lines 292697 292730 +33
Branches 17686 17688 +2
================================================
+ Hits 279634 279671 +37
- Misses 10655 10657 +2
+ Partials 2408 2402 -6 |
Thanks @mavasani @JoeRobich the 6.0 servicing request approved over e-mail. Feel free to merge! |
Ports #6029 to .NET6 release branch.
Customer Impact
A customer reported the issue in VS feedbacks which transferred to github: #6015 and it is reproduceable with the linked project.
When builds the project with CA1416 Platform Compatibility Analyzer enabled then the build never ends and memory grows continually, even stopping the build and closed the VS the
VBCSCompiler
process stays alive and memory keep growing, only option is kill the processCA1416 is included in SDK and enabled by default, therefore it could happen for any customer's project that happens to have a code section that reproes the issue.
Testing
Risk
Very low -
GlobalFlowStateAnalysisValueSet.Unset
is used to represent unanalyzed flow state,GlobalFlowStateAnalysisValueSet.Empty
is used to represent analyzed flow state with no analysis values. We initialize the flow states for the entry basic block of the CFG withUnset
value, but never replace theUnset
withEmpty
for subsequent passes. This in turn leads to incorrect merge when aKnown
value flows from the back edge to the loop start and ends up overriding theUnset
value instead of being overridden by theEmpty
value. Now we correctly perform this merge logic.