Skip to content
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

Build hangs after upgrading to 2.9.5 #2900

Closed
avivanoff opened this issue Oct 3, 2019 · 14 comments
Closed

Build hangs after upgrading to 2.9.5 #2900

avivanoff opened this issue Oct 3, 2019 · 14 comments
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzers Bug The product is not behaving according to its current intended design DataFlow

Comments

@avivanoff
Copy link

Analyzer package

Microsoft.CodeAnalysis.FxCopAnalyzers

Package Version

v2.9.5 (Latest)

Diagnostic ID

N/A

Repro steps

After upgrading from 2.9.4 to 2.9.5 one of my builds hangs. How do I diagnose the issue?

Expected behavior

Build completes.

Actual behavior

Build hangs and never completes.

@mavasani
Copy link
Member

mavasani commented Oct 3, 2019

  1. Would you be able to provide a repro project/solution to investigate?
  2. Otherwise, can you try to disable dataflow based rules by copying DataflowDefault.ruleset from inside the NuGet package to your project folder, changing all Dataflow rules to have Action=None, and using it as your project ruleset? If that helps we can try to dig deeper into narrowing the rule with the issue.

@avivanoff
Copy link
Author

Correction. Build took 1 hour 53 minutes instead of 22 seconds when run with RunAnalyzersDuringBuild=false.

@avivanoff
Copy link
Author

Disabling Dataflow rules fixes the problem.

@mavasani
Copy link
Member

mavasani commented Oct 3, 2019

Wondering if its the same issue as #2750. Can you try adding an editorconfig option to turn off interprocedural analysis with dataflow rules enabled (https://github.com/dotnet/roslyn-analyzers/blob/master/docs/Analyzer%20Configuration.md):

dotnet_code_quality.interprocedural_analysis_kind = None

Note that root causing the dataflow performance issue would need some kind of a repro project.

@mavasani
Copy link
Member

mavasani commented Oct 3, 2019

Also, if you are unable to provide a repro, would it be possible for you to selectively turn on one Dataflow rule at a time for us to know which exact rule has the issue?

@avivanoff
Copy link
Author

The rules that takes forever is "CA5390: Do Not Hard Code Encryption Key".

@mavasani
Copy link
Member

mavasani commented Oct 3, 2019

@avivanoff Seems like the rule is disabled by default:

. Did you turn on this rule explicitly with your ruleset?

Tagging @dotpaul @LLLXXXCCC - it may be an issue with Tainted analysis still being too aggressive in when to run DFA OR could be an underlying performance issue with DFA that needs to be fixed.

@mavasani mavasani added Area-Microsoft.CodeAnalysis.NetAnalyzers Bug The product is not behaving according to its current intended design DataFlow labels Oct 3, 2019
@mavasani mavasani added this to the vNext milestone Oct 3, 2019
@avivanoff
Copy link
Author

Yes, I did. It is a good rule.

What I just found is that this rule does not seem to work. The folowing code should trigger it,. right?

using (var aes = Aes.Create())
{
    aes.Key = new Byte[] { 1, 2, 3 };
}

@mavasani
Copy link
Member

mavasani commented Oct 3, 2019

Yes, I did. It is a good rule.

Great, I was just confirming if users will run into this performance issue from the default configuration or not.

Can you please file a separate issue for the functional bug? @dotpaul @LLLXXXCCC can comment/take a look at that issue. Thanks!

@avivanoff
Copy link
Author

@dotpaul, @LLLXXXCCC, a new issue was created.

@avivanoff
Copy link
Author

Just to be clear. CA5390 causes no issues with 2.9.4.

@dotpaul
Copy link
Contributor

dotpaul commented Oct 15, 2019

@avivanoff Would you mind trying https://dotnet.myget.org/feed/roslyn-analyzers/package/nuget/Microsoft.CodeAnalysis.FxCopAnalyzers/2.9.6-beta1.19510.4+fb3ada28 ?

I expect it to be slower than 2.9.4, but should actually finish.

@avivanoff
Copy link
Author

Looks good in 2.9.7.

@mavasani mavasani closed this as completed Nov 4, 2019
@dotpaul
Copy link
Contributor

dotpaul commented Nov 4, 2019

#2987 also addresses this

@jmarolf jmarolf modified the milestones: vNext, .NET 5 Preview 8 Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzers Bug The product is not behaving according to its current intended design DataFlow
Projects
None yet
Development

No branches or pull requests

4 participants