Skip to content

ArgumentException in Microsoft.CodeAnalysis.SymbolKey.ErrorTypeSymbolKey.Resolve #39936

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


Visual Studio 2019 16.3.9 just crashed with the trace below. I was working in 7 files with changes which were not recovered. Why can an analyzer crash the IDE?

There's no apparent way for me to reproduce, as I don't know what triggered the crash.

Application: devenv.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: System.ArgumentException: Wrong number of type arguments
Parameter name: typeArguments
   at Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol.Construct(ImmutableArray`1 typeArguments, Boolean unbound)
   at Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol.Microsoft.CodeAnalysis.INamedTypeSymbol.Construct(ITypeSymbol[] typeArguments)
   at Microsoft.CodeAnalysis.SymbolKey.ErrorTypeSymbolKey.Resolve(SymbolKeyReader reader)
   at Microsoft.CodeAnalysis.SymbolKey.SymbolKeyReader.ReadWorker(SymbolKeyType type)
   at Microsoft.CodeAnalysis.SymbolKey.SymbolKeyReader.ReadSymbolKey()
   at Microsoft.CodeAnalysis.SymbolKey.Reader`1.ReadArray[T](Func`1 readFunction)
   at Microsoft.CodeAnalysis.SymbolKey.SymbolKeyReader.ReadSymbolKeyArray[TSymbol]()
   at Microsoft.CodeAnalysis.SymbolKey.MethodSymbolKey.Resolve(SymbolKeyReader reader, Boolean isPartialMethodImplementationPart, IMethodSymbol method)
   at Microsoft.CodeAnalysis.SymbolKey.MethodSymbolKey.Resolve(SymbolKeyReader reader, String metadataName, Int32 arity, Boolean isPartialMethodImplementationPart, PooledArrayBuilder`1 parameterRefKinds, Int32 beforeParametersPosition, IMethodSymbol method)
   at Microsoft.CodeAnalysis.SymbolKey.MethodSymbolKey.Resolve(SymbolKeyReader reader)
   at Microsoft.CodeAnalysis.SymbolKey.SymbolKeyReader.ReadWorker(SymbolKeyType type)
   at Microsoft.CodeAnalysis.SymbolKey.SymbolKeyReader.ReadSymbolKey()
   at Microsoft.CodeAnalysis.SymbolKey.ResolveString(String symbolKey, Compilation compilation, Boolean ignoreAssemblyKey, Boolean resolveLocations, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.FindSymbols.SymbolFinder.<FindSourceDefinitionWorkerAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.FindSymbols.SymbolFinder.<FindSourceDefinitionAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService.RenameRewriter.<RenameAndAnnotateAsync>d__39.MoveNext()
Stack:
   at System.Environment.FailFast(System.String, System.Exception)
   at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception)
   at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action`1<System.Exception>)
   at Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportUnlessCanceled(System.Exception)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter+<RenameAndAnnotateAsync>d__39.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(System.Threading.Tasks.Task)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter+<RenameAndAnnotateAsync>d__39.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SyntaxToken, Microsoft.CodeAnalysis, Version=3.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].Start[[Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter+<RenameAndAnnotateAsync>d__39, Microsoft.CodeAnalysis.CSharp.Workspaces, Version=3.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<RenameAndAnnotateAsync>d__39 ByRef)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter.RenameAndAnnotateAsync(Microsoft.CodeAnalysis.SyntaxToken, Microsoft.CodeAnalysis.SyntaxToken, Boolean, Boolean)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter.VisitToken(Microsoft.CodeAnalysis.SyntaxToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitIdentifierName(Microsoft.CodeAnalysis.CSharp.Syntax.IdentifierNameSyntax)
   at Microsoft.CodeAnalysis.CSharp.Syntax.IdentifierNameSyntax.Accept[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitMemberAccessExpression(Microsoft.CodeAnalysis.CSharp.Syntax.MemberAccessExpressionSyntax)
   at Microsoft.CodeAnalysis.CSharp.Syntax.MemberAccessExpressionSyntax.Accept[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitInvocationExpression(Microsoft.CodeAnalysis.CSharp.Syntax.InvocationExpressionSyntax)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter.VisitInvocationExpression(Microsoft.CodeAnalysis.CSharp.Syntax.InvocationExpressionSyntax)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InvocationExpressionSyntax.Accept[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitReturnStatement(Microsoft.CodeAnalysis.CSharp.Syntax.ReturnStatementSyntax)
   at Microsoft.CodeAnalysis.CSharp.Syntax.ReturnStatementSyntax.Accept[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitListElement[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.SyntaxList`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitBlock(Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax)
   at Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax.Accept[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitMethodDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax)
   at Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax.Accept[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitListElement[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.SyntaxList`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitClassDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax)
   at Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax.Accept[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitListElement[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.SyntaxList`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitNamespaceDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax)
   at Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax.Accept[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitListElement[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.SyntaxList`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitCompilationUnit(Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax)
   at Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax.Accept[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor`1<System.__Canon>)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService+RenameRewriter.Visit(Microsoft.CodeAnalysis.SyntaxNode)
   at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService.AnnotateAndRename(Microsoft.CodeAnalysis.Rename.RenameRewriterParameters)
   at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session+<AnnotateAndRename_WorkerAsync>d__26.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session+<AnnotateAndRename_WorkerAsync>d__26, Microsoft.CodeAnalysis.Workspaces, Version=3.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<AnnotateAndRename_WorkerAsync>d__26 ByRef)
   at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session.AnnotateAndRename_WorkerAsync(Microsoft.CodeAnalysis.Solution, Microsoft.CodeAnalysis.Solution, System.Collections.Generic.HashSet`1<Microsoft.CodeAnalysis.DocumentId>, System.Collections.Generic.ISet`1<Microsoft.CodeAnalysis.Rename.RenameLocation>, Microsoft.CodeAnalysis.Rename.ConflictEngine.RenamedSpansTracker, Boolean)
   at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session+<ResolveConflictsAsync>d__18.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session+<ResolveConflictsAsync>d__18, Microsoft.CodeAnalysis.Workspaces, Version=3.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ResolveConflictsAsync>d__18 ByRef)
   at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session.ResolveConflictsAsync()
   at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver.ResolveConflictsAsync(Microsoft.CodeAnalysis.Rename.RenameLocations, System.String, System.String, Microsoft.CodeAnalysis.Options.OptionSet, System.Func`2<System.Collections.Generic.IEnumerable`1<Microsoft.CodeAnalysis.ISymbol>,System.Nullable`1<Boolean>>, System.Threading.CancellationToken)
   at Microsoft.CodeAnalysis.Rename.Renamer+<RenameAsync>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Rename.Renamer+<RenameAsync>d__3, Microsoft.CodeAnalysis.Workspaces, Version=3.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<RenameAsync>d__3 ByRef)
   at Microsoft.CodeAnalysis.Rename.Renamer.RenameAsync(Microsoft.CodeAnalysis.Rename.RenameLocations, System.String, System.Func`2<Microsoft.CodeAnalysis.Location,Boolean>, System.Func`2<System.Collections.Generic.IEnumerable`1<Microsoft.CodeAnalysis.ISymbol>,System.Nullable`1<Boolean>>, System.Threading.CancellationToken)
   at Microsoft.CodeAnalysis.Rename.Renamer+<RenameSymbolAsync>d__4.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task.FinishStageThree()
   at System.Threading.Tasks.Task`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.__Canon)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.__Canon)
   at Microsoft.CodeAnalysis.Rename.RenameLocations+<FindAsync>d__26.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task.FinishStageThree()
   at System.Threading.Tasks.Task`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.__Canon)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.__Canon)
   at Microsoft.CodeAnalysis.Rename.RenameLocations+<AddLocationsReferenceSymbolsAsync>d__30.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task.FinishStageThree()
   at System.Threading.Tasks.Task.FinishStageTwo()
   at System.Threading.Tasks.Task.Finish(Boolean)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
   at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Original Comments

Visual Studio Feedback System on 11/13/2019, 01:41 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Visual Studio Feedback System on 11/15/2019, 03:05 PM:

This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.


Original Solutions

Paul Graves solved on 11/21/2019, 10:56 AM, 0 votes:

I have a reproducible error in a solution in the very latest VS 2019 16.3.10 and W10 Pro 1903 18362.476

The exact stack location of the out of memory occurs randomly but it is always within Microsoft.CodeAnalysis:

Application: devenv.exe Framework Version: v4.0.30319 Description: The application requested process termination through System.Environment.FailFast(string message). Message: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.Collections.Immutable.ImmutableArray`1.Builder.ToArray() at Microsoft.CodeAnalysis.PooledObjects.ArrayBuilder`1.ToImmutableAndFree() at Microsoft.CodeAnalysis.CSharp.Symbols.AbstractTypeMap.SubstituteTypes(ImmutableArray`1 original) at Microsoft.CodeAnalysis.CSharp.OverloadResolution.IsApplicable[TMember](TMember member, TMember leastOverriddenMember, ArrayBuilder`1 typeArgumentsBuilder, AnalyzedArguments arguments, EffectiveParameters originalEffectiveParameters, EffectiveParameters constructedEffectiveParameters, ImmutableArray`1 argsToParamsMap, Boolean hasAnyRefOmittedArgument, Boolean inferWithDynamic, Boolean completeResults, HashSet`1& useSiteDiagnostics) at Microsoft.CodeAnalysis.CSharp.OverloadResolution.IsMemberApplicableInNormalForm[TMember](TMember member, TMember leastOverriddenMember, ArrayBuilder`1 typeArguments, AnalyzedArguments arguments, Boolean isMethodGroupConversion, Boolean allowRefOmittedArguments, Boolean inferWithDynamic, Boolean completeResults, HashSet`1& useSiteDiagnostics) at Microsoft.CodeAnalysis.CSharp.OverloadResolution.AddMemberToCandidateSet[TMember](TMember member, ArrayBuilder`1 results, ArrayBuilder`1 members, ArrayBuilder`1 typeArguments, BoundExpression receiverOpt, AnalyzedArguments arguments, Boolean completeResults, Boolean isMethodGroupConversion, Boolean allowRefOmittedArguments, Dictionary`2 containingTypeMapOpt, Boolean inferWithDynamic, HashSet`1& useSiteDiagnostics, Boolean allowUnexpandedForm)

....

I believe this has been caused by someone managing to introduce into the codebase of the solution some new code that has c# 7.2 language features when the containing project is on a lower version of .NET that doesn't support these features.

If that project is in the solution (say as a unit test project as in our case) - it appears still to build but will crash the code analyser (presumably because it isn't expecting to see that syntax in that project .NET version!)

Having refactored these language features out, it has not been reproducible.

Hope this helps others as I have just lost over a day finding this out!

Manish Vasani on 11/21/2019, 11:08 AM:

Hi Paul,
Can you please submit a separate feedback ticket? The original reported bug is a crash from System.ArgumentException. Your report seems to be an unrelated OutOfMemory exception.

Regards,
Manish

Metadata

Metadata

Labels

Area-IDEBugDeveloper CommunityThe issue was originally reported on https://developercommunity.visualstudio.comResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedTenet-ReliabilityCustomer telemetry indicates that the product is failing in a crash/hang/dataloss manner.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions