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

Visual Studio reports "Feature 'Diagnostic analyzer runner' is currently unavailable due to an internal error" as a result of AnalyzerExecutor.ExecuteBlockActionsCore calling Enumerable.Cast( null ) #65837

Closed
antiduh opened this issue Dec 7, 2022 · 2 comments
Labels
Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@antiduh
Copy link

antiduh commented Dec 7, 2022

Version Used: Visual Studio 2022 17.4.2

Steps to Reproduce: Occurs randomly while typing.

Highlighted Error:

RPC server exception:
System.ArgumentNullException: Value cannot be null. (Parameter 'source')
      at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
      at System.Linq.Enumerable.Cast[TResult](IEnumerable source)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteBlockActionsCore[TBlockStartAction,TBlockAction,TNodeAction,TNodeStateData,TNode,TLanguageKindEnum](IEnumerable`1 startActions, IEnumerable`1 actions, IEnumerable`1 endActions, DiagnosticAnalyzer analyzer, SyntaxNode declaredNode, ISymbol declaredSymbol, ImmutableArray`1 executableBlocks, Func`2 getNodesToAnalyze, SemanticModel semanticModel, Func`2 getKind, BlockAnalyzerStateData`2 analyzerState, Boolean isGeneratedCode)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.TryExecuteCodeBlockActions[TLanguageKindEnum](IEnumerable`1 codeBlockStartActions, IEnumerable`1 codeBlockActions, IEnumerable`1 codeBlockEndActions, DiagnosticAnalyzer analyzer, SyntaxNode declaredNode, ISymbol declaredSymbol, ImmutableArray`1 executableCodeBlocks, SemanticModel semanticModel, Func`2 getKind, Int32 declarationIndex, AnalysisScope analysisScope, AnalysisState analysisState, Boolean isGeneratedCode)

Full Stack trace:

StreamJsonRpc.RemoteInvocationException: Value cannot be null. (Parameter 'source')
   at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__143`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.<TryInvokeAsync>d__16`1.MoveNext()
RPC server exception:
System.ArgumentNullException: Value cannot be null. (Parameter 'source')
      at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
      at System.Linq.Enumerable.Cast[TResult](IEnumerable source)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteBlockActionsCore[TBlockStartAction,TBlockAction,TNodeAction,TNodeStateData,TNode,TLanguageKindEnum](IEnumerable`1 startActions, IEnumerable`1 actions, IEnumerable`1 endActions, DiagnosticAnalyzer analyzer, SyntaxNode declaredNode, ISymbol declaredSymbol, ImmutableArray`1 executableBlocks, Func`2 getNodesToAnalyze, SemanticModel semanticModel, Func`2 getKind, BlockAnalyzerStateData`2 analyzerState, Boolean isGeneratedCode)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.TryExecuteCodeBlockActions[TLanguageKindEnum](IEnumerable`1 codeBlockStartActions, IEnumerable`1 codeBlockActions, IEnumerable`1 codeBlockEndActions, DiagnosticAnalyzer analyzer, SyntaxNode declaredNode, ISymbol declaredSymbol, ImmutableArray`1 executableCodeBlocks, SemanticModel semanticModel, Func`2 getKind, Int32 declarationIndex, AnalysisScope analysisScope, AnalysisState analysisState, Boolean isGeneratedCode)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver`1.<>c__DisplayClass12_0.<TryExecuteDeclaringReferenceActions>g__executeCodeBlockActions|8(ImmutableArray`1 executableCodeBlocks, IEnumerable`1 codeBlockActions)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver`1.<>c__DisplayClass12_0.<TryExecuteDeclaringReferenceActions>g__executeExecutableCodeActions|3()
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver`1.TryExecuteDeclaringReferenceActions(SyntaxReference decl, Int32 declarationIndex, SymbolDeclaredCompilationEvent symbolEvent, AnalysisScope analysisScope, AnalysisState analysisState, GroupedAnalyzerActions coreActions, GroupedAnalyzerActions additionalPerSymbolActions, Boolean shouldExecuteSyntaxNodeActions, Boolean shouldExecuteOperationActions, Boolean shouldExecuteCodeBlockActions, Boolean shouldExecuteOperationBlockActions, Boolean isInGeneratedCode, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver`1.TryExecuteDeclaringReferenceActions(SymbolDeclaredCompilationEvent symbolEvent, AnalysisScope analysisScope, AnalysisState analysisState, Boolean isGeneratedCodeSymbol, IGroupedAnalyzerActions additionalPerSymbolActions, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver.TryProcessSymbolDeclaredAsync(SymbolDeclaredCompilationEvent symbolEvent, AnalysisScope analysisScope, AnalysisState analysisState, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver.TryProcessEventCoreAsync(CompilationEvent compilationEvent, AnalysisScope analysisScope, AnalysisState analysisState, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver.ProcessEventAsync(CompilationEvent e, AnalysisScope analysisScope, AnalysisState analysisState, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver.ProcessCompilationEventsCoreAsync(AnalysisScope analysisScope, AnalysisState analysisState, Boolean prePopulatedEventQueue, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver.<>c__DisplayClass128_0.<<ProcessCompilationEventsAsync>b__2>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver.ProcessCompilationEventsAsync(AnalysisScope analysisScope, AnalysisState analysisState, Boolean prePopulatedEventQueue, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver.ExecutePrimaryAnalysisTaskAsync(AnalysisScope analysisScope, AnalysisState analysisState, Boolean usingPrePopulatedEventQueue, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver.AttachQueueAndProcessAllEventsAsync(AsyncQueue`1 eventQueue, AnalysisScope analysisScope, AnalysisState analysisState, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.ComputeAnalyzerDiagnosticsCoreAsync(AnalyzerDriver driver, AsyncQueue`1 eventQueue, AnalysisScope analysisScope, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.<>c__DisplayClass67_1.<<ComputeAnalyzerDiagnosticsAsync>b__1>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.ComputeAnalyzerDiagnosticsAsync(AnalysisScope analysisScope, Func`1 getPendingEventsOpt, Int32 newTaskToken, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.ComputeAnalyzerSemanticDiagnosticsAsync(SemanticModel model, AnalysisScope analysisScope, CancellationToken cancellationToken, Boolean forceCompletePartialTrees)
      at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalysisResultCoreAsync(SemanticModel model, Nullable`1 filterSpan, ImmutableArray`1 analyzers, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.Extensions.GetAnalysisResultAsync(CompilationWithAnalyzers compilationWithAnalyzers, DocumentAnalysisScope documentAnalysisScope, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.Extensions.GetAnalysisResultAsync(CompilationWithAnalyzers compilationWithAnalyzers, DocumentAnalysisScope documentAnalysisScope, Project project, DiagnosticAnalyzerInfoCache analyzerInfoCache, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.Diagnostics.DiagnosticComputer.AnalyzeAsync(CompilationWithAnalyzers compilationWithAnalyzers, BidirectionalMap`2 analyzerToIdMap, ImmutableArray`1 analyzers, SkippedHostAnalyzersInfo skippedAnalyzersInfo, Boolean reportSuppressedDiagnostics, Boolean logPerformanceInfo, Boolean getTelemetryInfo, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.Diagnostics.DiagnosticComputer.GetDiagnosticsAsync(IEnumerable`1 analyzerIds, Boolean reportSuppressedDiagnostics, Boolean logPerformanceInfo, Boolean getTelemetryInfo, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.RemoteDiagnosticAnalyzerService.<>c__DisplayClass4_0.<<CalculateDiagnosticsAsync>b__0>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass7_0`1.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Int32 workspaceVersion, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Int32 workspaceVersion, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunWithSolutionAsync[T](Checksum solutionChecksum, Func`2 implementation, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.RemoteDiagnosticAnalyzerService.CalculateDiagnosticsAsync(Checksum solutionChecksum, DiagnosticArguments arguments, CancellationToken cancellationToken)
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 7, 2022
@Youssef1313
Copy link
Member

@mavasani Is this the one you fixed in #65083 ?

@mavasani
Copy link
Contributor

mavasani commented Dec 7, 2022

Yes, this should be fixed in 17.4.3 once released.

@mavasani mavasani closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

3 participants