Skip to content

RemoteInvocationException: This program location is thought to be unreachable. #59636

@kxxt

Description

@kxxt

Version Used: Visual Studio Version 17.2.0 Preview 1.0 (I don't know the version of Roslyn)

Steps to Reproduce:

I failed to reproduce this issue, but here was what I was doing when the crash happened.

  1. Open Visual Studio
  2. Typing some code that contains syntax errors.
// I inputed something like this: 
$"{asd]asad{sad}dasdf"
// Then I added some double quotation marks around the string and added an @ before it
@$"""{asd]asad{sad}dasdf""
// The analyzer crashed
  1. I got this error from Visual Studio: Diagnostic Analyzer runner is currently unavailable

Due to the delay of the error notification, it might be other things that caused the crash.

If this bug report is unhelpful to solve this crash or this is the wrong place to post this bug report, please simply close this issue.

Personally, I think the stacktrace might be helpful.

Expected Behavior:

This error shouldn't happen.

Actual Behavior:

The analyzer crashed.

StackTrace
StreamJsonRpc.RemoteInvocationException: This program location is thought to be unreachable.
   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()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
RPC server exception:
System.InvalidOperationException: This program location is thought to be unreachable.
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundAssignmentOperatorOperation(BoundAssignmentOperator boundAssignmentOperator)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundAssignmentOperatorOrMemberInitializerOperation(BoundAssignmentOperator boundAssignmentOperator)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateArgumentOperation(ArgumentKind kind, IParameterSymbol parameter, BoundExpression expression)
      at Microsoft.CodeAnalysis.CSharp.LocalRewriter.MakeArgumentsInEvaluationOrder(CSharpOperationFactory operationFactory, CSharpCompilation compilation, SyntaxNode syntax, ImmutableArray`1 arguments, Symbol methodOrIndexer, Boolean expanded, ImmutableArray`1 argsToParamsOpt, BitVector defaultArguments, Boolean invokedAsExtensionMethod)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.DeriveArguments(Symbol methodOrIndexer, ImmutableArray`1 boundArguments, ImmutableArray`1 argumentsToParametersOpt, BitVector defaultArguments, Boolean expanded, SyntaxNode invocationSyntax, Boolean invokedAsExtensionMethod)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.DeriveArguments(BoundNode containingExpression)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundCallOperation(BoundCall boundCall)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundAwaitExpressionOperation(BoundAwaitExpression boundAwaitExpression)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundExpressionStatementOperation(BoundExpressionStatement boundExpressionStatement)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateFromArray[TBoundNode,TOperation](ImmutableArray`1 boundNodes)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundBlockOperation(BoundBlock boundBlock)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundIfStatementOperation(BoundIfStatement boundIfStatement)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateFromArray[TBoundNode,TOperation](ImmutableArray`1 boundNodes)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundBlockOperation(BoundBlock boundBlock)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundIfStatementOperation(BoundIfStatement boundIfStatement)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundIfStatementOperation(BoundIfStatement boundIfStatement)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundIfStatementOperation(BoundIfStatement boundIfStatement)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateFromArray[TBoundNode,TOperation](ImmutableArray`1 boundNodes)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundBlockOperation(BoundBlock boundBlock)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateMethodBodyOperation(BoundNonConstructorMethodBody boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.CSharp.MemberSemanticModel.GetRootOperation()
      at Microsoft.CodeAnalysis.CSharp.MemberSemanticModel.GetOperationWorker(CSharpSyntaxNode node, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.CSharp.SyntaxTreeSemanticModel.GetOperationWorker(CSharpSyntaxNode node, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetOperationCore(SyntaxNode node, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver`1.GetOperationBlocksToAnalyze(ImmutableArray`1 executableBlocks, SemanticModel semanticModel, CancellationToken cancellationToken)
      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>d__132.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.Diagnostics.AnalyzerDriver.<TryProcessEventCoreAsync>d__131.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.Diagnostics.AnalyzerDriver.<ProcessEventAsync>d__129.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver.<ProcessCompilationEventsCoreAsync>d__128.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   --- 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.Diagnostics.AnalyzerDriver.<>c__DisplayClass127_0.<<ProcessCompilationEventsAsync>b__2>d.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.Diagnostics.AnalyzerDriver.<ProcessCompilationEventsAsync>d__127.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.Diagnostics.AnalyzerDriver.<ExecutePrimaryAnalysisTaskAsync>d__96.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.Diagnostics.AnalyzerDriver.<AttachQueueAndProcessAllEventsAsync>d__94.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.Diagnostics.CompilationWithAnalyzers.<ComputeAnalyzerDiagnosticsCoreAsync>d__72.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.Diagnostics.CompilationWithAnalyzers.<>c__DisplayClass67_1.<<ComputeAnalyzerDiagnosticsAsync>b__1>d.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.<ComputeAnalyzerDiagnosticsAsync>d__67.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.Diagnostics.CompilationWithAnalyzers.<ComputeAnalyzerSemanticDiagnosticsAsync>d__66.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.Diagnostics.CompilationWithAnalyzers.<GetAnalysisResultCoreAsync>d__64.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.Diagnostics.Extensions.<GetAnalysisResultAsync>d__9.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.Diagnostics.Extensions.<GetAnalysisResultAsync>d__8.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.Diagnostics.DiagnosticComputer.<AnalyzeAsync>d__9.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.Diagnostics.DiagnosticComputer.<GetDiagnosticsAsync>d__8.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.RemoteDiagnosticAnalyzerService.<>c__DisplayClass3_0.<<CalculateDiagnosticsAsync>b__0>d.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.BrokeredServiceBase.<RunServiceImplAsync>d__13`1.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions