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

builds breaking because analyzers fail with Value cannot be null. (Parameter 'type') #82467

Closed
radical opened this issue Feb 22, 2023 · 16 comments
Assignees
Labels
area-VM-meta-mono code-analyzer Marks an issue that suggests a Roslyn analyzer tracking This issue is tracking the completion of other related issues.
Milestone

Comments

@radical
Copy link
Member

radical commented Feb 22, 2023

Failing rolling build hit for browser-wasm windows Release LibraryTests_AOT:

CSC : error CS8032: An instance of analyzer Microsoft.NetCore.CSharp.Analyzers.Resources.CSharpMarkAssembliesWithNeutralResourcesLanguageAnalyzer cannot be created from D:\a\_work\1\s\.packages\microsoft.codeanalysis.netanalyzers\8.0.0-preview1.23117.2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll : Value cannot be null. (Parameter 'type'). [D:\a\_work\1\s\src\libraries\System.ComponentModel.Composition.Registration\src\System.ComponentModel.Composition.Registration.csproj::TargetFramework=net8.0]

Changes since the last passing rolling build - f6bed51...2819a94

cc @lewing @steveisok

Known Issue Error Message

Fill the error message using known issues guidance.

{
  "ErrorPattern": ".*An instance of analyzer Microsoft.NetCore.CSharp.Analyzers.Resources.CSharpMarkAssembliesWithNeutralResourcesLanguageAnalyzer cannot be created .*Value cannot be null.*",
  "BuildRetry": false
}

Report

Build Definition Step Name Console log Pull Request
180513 dotnet/runtime Restore and Build Product Log #82476
180257 dotnet/runtime Restore and Build Product Log #82350
179712 dotnet/runtime Build product Log

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 3 3
@radical radical added blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' code-analyzer Marks an issue that suggests a Roslyn analyzer labels Feb 22, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Feb 22, 2023
@radical radical changed the title CSharpMarkAssembliesWithNeutralResourcesLanguageAnalyzer fails with Value cannot be null. (Parameter 'type') Rolling build for wasm/aot breaking because CSharpMarkAssembliesWithNeutralResourcesLanguageAnalyzer fails with Value cannot be null. (Parameter 'type') Feb 22, 2023
@lewing
Copy link
Member

lewing commented Feb 22, 2023

This isn't specific to wasm is it?

@lewing
Copy link
Member

lewing commented Feb 22, 2023

@lewing lewing changed the title Rolling build for wasm/aot breaking because CSharpMarkAssembliesWithNeutralResourcesLanguageAnalyzer fails with Value cannot be null. (Parameter 'type') builds breaking because CSharpMarkAssembliesWithNeutralResourcesLanguageAnalyzer fails with Value cannot be null. (Parameter 'type') Feb 22, 2023
@lewing
Copy link
Member

lewing commented Feb 22, 2023

@stephentoub
Copy link
Member

stephentoub commented Feb 22, 2023

Seems pretty much every PR is hitting this on at least one leg. It's also not always the same analyzer failing.

Did we recently take updates to anything to do with Roslyn, compiler dependencies, etc?

@stephentoub stephentoub removed untriaged New issue has not been triaged by the area owner code-analyzer Marks an issue that suggests a Roslyn analyzer labels Feb 22, 2023
@jkoritzinsky
Copy link
Member

Yes, we recently updated Roslyn. We have a PR out to revert the update as it's also causing timeouts.

@stephentoub
Copy link
Member

cc: @jaredpar

@lewing
Copy link
Member

lewing commented Feb 22, 2023

revert pr is #82466

@hoyosjs
Copy link
Member

hoyosjs commented Feb 22, 2023

Merged to unblock

@jaredpar
Copy link
Member

@jmarolf, @mavasani FYI, looks like an analyzer break here.

@steveisok
Copy link
Member

steveisok commented Feb 24, 2023

Should we keep this open now that #82466 went in?

@lewing
Copy link
Member

lewing commented Feb 24, 2023

probably at least until we have a roslyn issue tracking the regression here.

we have #82583 tracking performance

and dotnet/roslyn#66900 tracking the parameter regression

but nothing tracking these seemingly random analyzer failures

@lewing lewing changed the title builds breaking because CSharpMarkAssembliesWithNeutralResourcesLanguageAnalyzer fails with Value cannot be null. (Parameter 'type') builds breaking because analyzers fail with Value cannot be null. (Parameter 'type') Feb 24, 2023
@steveisok steveisok added code-analyzer Marks an issue that suggests a Roslyn analyzer and removed blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' labels Feb 24, 2023
@steveisok steveisok added this to the 8.0.0 milestone Feb 24, 2023
@steveisok steveisok added the tracking This issue is tracking the completion of other related issues. label Feb 24, 2023
@RikkiGibson
Copy link
Contributor

@jaredpar have we ruled out the cause possibly being recent analyzer loader changes?

@jaredpar
Copy link
Member

jaredpar commented Feb 24, 2023

@RikkiGibson seems doubtful it's related. Generally analyzer load failures will result in missing method exception, assembly load, file not found, etc ... The failures would also be very deterministic. This is a random-ish failure on a null value. My suspicion would be race condition in the analyzer.

But @stephentoub mentioned

It's also not always the same analyzer failing.

So probably not in the specific analyzer. May need to grab a debug compiler and push it through the paces here. One where we can add some more diagnostics / trigger fail fasts so we can see what is going on.

Another potential reason is the underlying CLR bug causing #82583 is manifesting here as well.

@jaredpar
Copy link
Member

@lewing my investigation into this is proving difficult until we get global.json to point to a runtime with the fix for #80822. Without that the compiler is crashing 300+ times a build. That's making it difficult to separate out the noise. Keeping an eye on #82599 which will move us to preview1 which has the fix.

@jaredpar
Copy link
Member

@lewing

Have PR #82734 where I'm simply pushing the compiler forward now that runtime has moved to 8.0.100-preview.1.23115.2. The reason that is important is it has the fix for #80822 inside it. That deals with issues around collectable assemblies and the roslyn update in question moved our entire analyzer loading into collectable assemblies. It's not an explicit consequence of that bug but it seems like a possible one.

The PR #82734 is complicated because of the high number of test failures. Looking through the individual failures though I don't see the analyzer failure anymore. It's consistently popped up at least once in all my test runs against older CLR versions. It's undeniably a race condition of sorts though so even a clean run isn't good evidence of success.

I'm going to force another run here. If we don't see any more instances of this failure then I think the best path forward is to assume #80822 was the root of the failure and move forward with a new Roslyn drop. If that proves wrong we can back it out.

@jaredpar
Copy link
Member

jaredpar commented Mar 1, 2023

Had multiple successful builds with the patched runtime. At this point reached the conclusion that it was a side effect of #80822. If this problem returns after we move to a new Roslyn compiler in the future please let me know and I will dig into it further.

@jaredpar jaredpar closed this as completed Mar 1, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM-meta-mono code-analyzer Marks an issue that suggests a Roslyn analyzer tracking This issue is tracking the completion of other related issues.
Projects
None yet
Development

No branches or pull requests

9 participants