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

assemblyloading_assemblylocationnotadded always failed in Linux #66621

Open
runfoapp bot opened this issue Jan 31, 2023 · 3 comments
Open

assemblyloading_assemblylocationnotadded always failed in Linux #66621

runfoapp bot opened this issue Jan 31, 2023 · 3 comments
Assignees
Milestone

Comments

@runfoapp
Copy link

runfoapp bot commented Jan 31, 2023

Runfo Tracking Issue: assemblyloading_assemblylocationnotadded always failed in Linux

Build Definition Kind Run Name

Build Result Summary

Day Hit Count Week Hit Count Month Hit Count
0 0 0
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Interactive untriaged Issues and PRs which have not yet been triaged by a lead labels Jan 31, 2023
@Cosifne
Copy link
Member

Cosifne commented Jan 31, 2023

Note: This is merged into main #66492
But when run later, block other PR like #66613
I tried rerun many times, no success.

The stack trace is:

System.OutOfMemoryException : Exception of type 'System.OutOfMemoryException' was thrown.


Stack trace
   at Microsoft.CodeAnalysis.SeparatedSyntaxList`1.System.Collections.Generic.IEnumerable<TNode>.GetEnumerator()
   at System.Collections.Immutable.ImmutableArray`1.Builder.AddRange(IEnumerable`1 items)
   at Microsoft.CodeAnalysis.PooledObjects.ArrayBuilder`1.AddRange(IEnumerable`1 items) in /_/src/Dependencies/PooledObjects/ArrayBuilder.cs:line 555
   at Microsoft.CodeAnalysis.CSharp.Symbol.GetAttributesToBind(OneOrMany`1 attributeDeclarationSyntaxLists, AttributeLocation symbolPart, BindingDiagnosticBag diagnostics, CSharpCompilation compilation, Func`2 attributeMatchesOpt, Binder rootBinderOpt, ImmutableArray`1& binders) in /_/src/Compilers/CSharp/Portable/Symbols/Symbol_Attributes.cs:line 603
   at Microsoft.CodeAnalysis.CSharp.Symbol.LoadAndValidateAttributes(OneOrMany`1 attributesSyntaxLists, CustomAttributesBag`1& lazyCustomAttributesBag, AttributeLocation symbolPart, Boolean earlyDecodingOnly, Binder binderOpt, Func`2 attributeMatchesOpt, Action`1 beforeAttributePartBound, Action`1 afterAttributePartBound) in /_/src/Compilers/CSharp/Portable/Symbols/Symbol_Attributes.cs:line 304
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceAssemblySymbol.EnsureAttributesAreBound() in /_/src/Compilers/CSharp/Portable/Symbols/Source/SourceAssemblySymbol.cs:line 1559
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceAssemblySymbol.GetSourceAttributesBag() in /_/src/Compilers/CSharp/Portable/Symbols/Source/SourceAssemblySymbol.cs:line 1574
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceAssemblySymbol.GetSourceDecodedWellKnownAttributeData() in /_/src/Compilers/CSharp/Portable/Symbols/Source/SourceAssemblySymbol.cs:line 1640
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceAssemblySymbol.get_AssemblyDelaySignAttributeSetting() in /_/src/Compilers/CSharp/Portable/Symbols/Source/SourceAssemblySymbol.cs:line 323
   at Microsoft.CodeAnalysis.CSharp.Symbols.SourceAssemblySymbol.get_IsDelaySigned() in /_/src/Compilers/CSharp/Portable/Symbols/Source/SourceAssemblySymbol.cs:line 881
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.get_IsDelaySigned() in /_/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs:line 3116
   at Microsoft.CodeAnalysis.Compilation.get_HasStrongName() in /_/src/Compilers/Core/Portable/Compilation/Compilation.cs:line 2388
   at Microsoft.CodeAnalysis.Compilation.ConstructModuleSerializationProperties(EmitOptions emitOptions, String targetRuntimeVersion, Guid moduleVersionId) in /_/src/Compilers/Core/Portable/Compilation/Compilation.cs:line 2254
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CreateModuleBuilder(EmitOptions emitOptions, IMethodSymbol debugEntryPoint, Stream sourceLinkStream, IEnumerable`1 embeddedTexts, IEnumerable`1 manifestResources, CompilationTestData testData, DiagnosticBag diagnostics, CancellationToken cancellationToken) in /_/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs:line 3143
   at Microsoft.CodeAnalysis.Compilation.CheckOptionsAndCreateModuleBuilder(DiagnosticBag diagnostics, IEnumerable`1 manifestResources, EmitOptions options, IMethodSymbol debugEntryPoint, Stream sourceLinkStream, IEnumerable`1 embeddedTexts, CompilationTestData testData, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/Compilation/Compilation.cs:line 3143
   at Microsoft.CodeAnalysis.Compilation.Emit(Stream peStream, Stream metadataPEStream, Stream pdbStream, Stream xmlDocumentationStream, Stream win32Resources, IEnumerable`1 manifestResources, EmitOptions options, IMethodSymbol debugEntryPoint, Stream sourceLinkStream, IEnumerable`1 embeddedTexts, RebuildData rebuildData, CompilationTestData testData, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/Compilation/Compilation.cs:line 2902

Another example run https://dev.azure.com/dnceng-public/public/_build/results?buildId=154270&view=results

@Cosifne
Copy link
Member

Cosifne commented Jan 31, 2023

cc @jaredpar

@jaredpar
Copy link
Member

jaredpar commented Jan 31, 2023

Context on this failure.

The code that introduced this failure was merged in #66492. During the review of that change we saw one test consistently failing on Linux and followed up with the runtime team in dotnet/runtime#81108. Once we confirmed there was a bug over there we disabled that test on Linux, continued working on the PR and didn't see any future issues. The PR was merged with several clean green runs.

Post merge we saw a different test fail on Linux. That was disabled and then another one started failing. At that point @Cosifne and I decided to just stop these tests running on Linux as fast as possible to get the builds moving again (c3afa4e).

It's unclear exactly what happened post merge to cause this to spread to most Linux runs. My suspicion is test partitioning changed such that it put more pressure on the underlying runtime issue resulting in wider spread failures. No evidence to back this up though, just a suspicion.

The PR #66612 reduces the compilation calls which appear to be putting pressure on the runtime by ~95%. Hopefully that will allow us to re-enable the Linux runs.

jaredpar added a commit to jaredpar/roslyn that referenced this issue Jan 31, 2023
This also has the added benefit that the entire .NET Core set of tests
run in less than one second. Previously it close to half a second per
test.

This will hopefully alleviate the pain for the runtime issue we're
hittnig running `AssemblyLoadContext` tests in CI. This reduces the
amount of compilations on this code path which seem to be the trigger
for the failure.

- dotnet#66621
- dotnet/runtime#81108
jaredpar added a commit to jaredpar/roslyn that referenced this issue Feb 1, 2023
This also has the added benefit that the entire .NET Core set of tests
run in less than one second. Previously it close to half a second per
test.

This will hopefully alleviate the pain for the runtime issue we're
hittnig running `AssemblyLoadContext` tests in CI. This reduces the
amount of compilations on this code path which seem to be the trigger
for the failure.

- dotnet#66621
- dotnet/runtime#81108
jaredpar added a commit to jaredpar/roslyn that referenced this issue Feb 1, 2023
This also has the added benefit that the entire .NET Core set of tests
run in less than one second. Previously it close to half a second per
test.

This will hopefully alleviate the pain for the runtime issue we're
hittnig running `AssemblyLoadContext` tests in CI. This reduces the
amount of compilations on this code path which seem to be the trigger
for the failure.

- dotnet#66621
- dotnet/runtime#81108
jaredpar added a commit to jaredpar/roslyn that referenced this issue Feb 2, 2023
This also has the added benefit that the entire .NET Core set of tests
run in less than one second. Previously it close to half a second per
test.

This will hopefully alleviate the pain for the runtime issue we're
hittnig running `AssemblyLoadContext` tests in CI. This reduces the
amount of compilations on this code path which seem to be the trigger
for the failure.

- dotnet#66621
- dotnet/runtime#81108
jaredpar pushed a commit that referenced this issue Feb 2, 2023
* Continued analyzer assembly loading work

This change responds to several concerns raised in #66492:

- Collapse the `AnalyzerAssembyLoader` hierarchy by one level and move
  more logic into the base type.
- Fix `AssemblyLoadContext` in tests to not replicate types. That means
  we can safely pass `ITestOutputHelper` into the custom
  `AssemblyLoadContext`
- Further strengthen the test separation

I have deliberately not changed the file names to reflect the new type
names because I wanted the review process to be smooth. Once I have two
sign offs for the change I will send another commit which does the
following:

- Rename
    - DefaultAnalyzerAssemblyLoaderTests.cs -> AnalyzerAssemblyLoaderTests.cs
    - DefaultAnalyzerAssemblyLoader.Core.cs -> AnalyzerAssemblyLoader.Core.cs
    - DefaultAnalyzerAssemblyLoader.Desktop.cs -> AnalyzerAssemblyLoader.Desktop.cs
    - DefaultAnalyzerAssemblyLoader.cs -> AnalyzerAssemblyLoader.cs
- Move
    - `DefaultAnalyzerAssemblyLoader` into DefaultAnalyzerAssemblyLoader.cs
    - `InvokeUtil` to InvokeUtil.cs. As constructed every edit to this
      type causes Test Explorer to lose context on the theory branches.
      Doesn't come back until rebuild. Will be smoother editting in its own
      file.

That should get is into the style we expect here. After that I will
merge once tests are green.

* Unload AssemblyLoadContext after test completion

* Reuse AssemblyLoadTestFixture across test runs

This also has the added benefit that the entire .NET Core set of tests
run in less than one second. Previously it close to half a second per
test.

This will hopefully alleviate the pain for the runtime issue we're
hittnig running `AssemblyLoadContext` tests in CI. This reduces the
amount of compilations on this code path which seem to be the trigger
for the failure.

- #66621
- dotnet/runtime#81108

* Apply suggestions from code review

Co-authored-by: Rikki Gibson <[email protected]>

* PR feedback

* rename the files

* Fixup

---------

Co-authored-by: Rikki Gibson <[email protected]>
@arunchndr arunchndr removed the untriaged Issues and PRs which have not yet been triaged by a lead label Aug 3, 2023
@arunchndr arunchndr added this to the Backlog milestone Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants