dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.04k stars 4.03k forks source link

The JSON-RPC connection with the remote party was lost before the request could complete. #74916

Open vsfeedback opened 2 months ago

vsfeedback commented 2 months ago

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


[severity:It's more difficult to complete my work] Code Analysis, code colors and huge functionalities are broken because I get this error on VS :

StreamJsonRpc.ConnectionLostException : The JSON-RPC connection with the remote party was lost before the request could complete.
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async StreamJsonRpc.JsonRpc.InvokeCoreAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async StreamJsonRpc.JsonRpc.InvokeCoreAsync[TResult](<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.TryInvokeAsync[TService,TResult](<Unknown Parameters>)

on Event Viewer :

Application: ServiceHub.RoslynCodeAnalysisService.exe
CoreCLR Version: 8.0.724.31311
.NET Version: 8.0.7
Description: The process was terminated due to an internal error in the .NET Runtime at IP 0x00007FFCA581747E (0x00007FFCA57C0000) with exit code 0x80131506.
Nom de l’application défaillante ServiceHub.RoslynCodeAnalysisService.exe, version : 17.10.40238.44550, horodatage : 0x65a80000
Nom du module défaillant : coreclr.dll, version : 8.0.724.31311, horodatage : 0x666b49de
Code d’exception : 0xc0000005
Décalage d’erreur : 0x000000000005747e
ID du processus défaillant : 0x0x8E34
Heure de début de l’application défaillante : 0x0x1DAD6848367E53B
Chemin d’accès de l’application défaillante : C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\ServiceHub\Hosts\ServiceHub.Host.dotnet.x64\ServiceHub.RoslynCodeAnalysisService.exe
Chemin d’accès du module défaillant: C:\Program Files\Microsoft Visual Studio\2022\Community\dotnet\net8.0\runtime\shared\Microsoft.NETCore.App\8.0.7\coreclr.dll
ID de rapport : 2ba524fa-bab0-487d-96bd-16dd601cd029
Nom complet du package défaillant : 
ID de l’application relative au package défaillant : 

Original Comments

Feedback Bot on 7/15/2024, 00:56 AM:

(private comment, text removed)

Wenwen Fan [MSFT] on 7/15/2024, 02:34 AM:

(private comment, text removed)

Xavier Rocher on 7/15/2024, 09:10 AM:

(private comment, text removed)

Xavier Rocher on 7/30/2024, 01:15 AM:

(private comment, text removed)

Xavier Rocher on 8/9/2024, 05:21 AM:

(private comment, text removed)

Feedback Bot on 7/16/2024, 00:22 AM:

(private comment, text removed)

Xavier Rocher on 7/24/2024, 09:39 AM:

(private comment, text removed)

Cyrus Najmabadi [MSFT] on 7/29/2024, 01:21 PM:

(private comment, text removed)

Cyrus Najmabadi [MSFT] on 7/29/2024, 01:22 PM:

(private comment, text removed)

Lisa Gao (CSI Interfusion Inc) [MSFT] on 8/4/2024, 08:07 PM:

(private comment, text removed)

Xavier Rocher on 8/5/2024, 06:13 AM:

(private comment, text removed)

Xavier Rocher on 8/6/2024, 02:15 AM:

(private comment, text removed)


Original Solutions

(no solutions)

CyrusNajmabadi commented 2 months ago

User reports crash here:

System.ArgumentException: Not a C# symbol. (Parameter 'container')
      at Microsoft.CodeAnalysis.CSharp.Symbols.SymbolExtensions.EnsureCSharpSymbolOrNull(ISymbol symbol, String paramName)
      at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonCreateErrorTypeSymbol(INamespaceOrTypeSymbol container, String name, Int32 arity)
      at Microsoft.CodeAnalysis.SyntaxNode.get_Location()
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.DefaultVisit(BoundNode node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitExpressionWithoutStackGuard(BoundExpression node)
      at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.VisitExpressionWithStackGuard(BoundExpression node)
      at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.VisitExpressionWithStackGuard(Int32& recursionDepth, BoundExpression node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.Visit(BoundNode node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitRvalue(BoundExpression node, Boolean isKnownToBeAnLvalue)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitArgumentsBeforeCall(ImmutableArray`1 arguments, ImmutableArray`1 refKindsOpt)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.<VisitCall>g__visitArgumentsAndCompleteAnalysis|117_0(BoundCall node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitCall(BoundCall node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitExpressionWithoutStackGuard(BoundExpression node)
      at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.VisitExpressionWithStackGuard(Int32& recursionDepth, BoundExpression node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.Visit(BoundNode node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitRvalue(BoundExpression node, Boolean isKnownToBeAnLvalue)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitExpressionStatement(BoundExpressionStatement node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.Visit(BoundNode node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitStatement(BoundStatement statement)
      at Microsoft.CodeAnalysis.CSharp.DefiniteAssignmentPass.VisitStatementsWithLocalFunctions(BoundBlock block)
      at Microsoft.CodeAnalysis.CSharp.DefiniteAssignmentPass.VisitBlock(BoundBlock node)
      at Microsoft.CodeAnalysis.CSharp.DefiniteAssignmentPass.VisitLambda(BoundLambda node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitExpressionWithoutStackGuard(BoundExpression node)
      at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.VisitExpressionWithStackGuard(Int32& recursionDepth, BoundExpression node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.Visit(BoundNode node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitConversion(BoundConversion node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitExpressionWithoutStackGuard(BoundExpression node)
      at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.VisitExpressionWithStackGuard(Int32& recursionDepth, BoundExpression node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.Visit(BoundNode node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitRvalue(BoundExpression node, Boolean isKnownToBeAnLvalue)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitArgumentsBeforeCall(ImmutableArray`1 arguments, ImmutableArray`1 refKindsOpt)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.<VisitCall>g__visitArgumentsAndCompleteAnalysis|117_0(BoundCall node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitCall(BoundCall node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitExpressionWithoutStackGuard(BoundExpression node)
      at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.VisitExpressionWithStackGuard(BoundExpression node)
      at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.VisitExpressionWithStackGuard(Int32& recursionDepth, BoundExpression node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.Visit(BoundNode node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitRvalue(BoundExpression node, Boolean isKnownToBeAnLvalue)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitExpressionStatement(BoundExpressionStatement node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.Visit(BoundNode node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitStatement(BoundStatement statement)
      at Microsoft.CodeAnalysis.CSharp.DefiniteAssignmentPass.VisitStatementsWithLocalFunctions(BoundBlock block)
      at Microsoft.CodeAnalysis.CSharp.DefiniteAssignmentPass.VisitBlock(BoundBlock node)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.Visit(BoundNode node)
      at Microsoft.CodeAnalysis.CSharp.DefiniteAssignmentPass.Scan(Boolean& badRegion)
      at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.Analyze(Boolean& badRegion, Optional`1 initialState)
      at Microsoft.CodeAnalysis.CSharp.DefiniteAssignmentPass.Analyze(Boolean& badRegion, DiagnosticBag diagnostics)
      at Microsoft.CodeAnalysis.CSharp.DefiniteAssignmentPass.<Analyze>g__analyze|40_1(Boolean strictAnalysis, <>c__DisplayClass40_0&)
      at Microsoft.CodeAnalysis.CSharp.DefiniteAssignmentPass.Analyze(CSharpCompilation compilation, MethodSymbol member, BoundNode node, DiagnosticBag diagnostics, ImmutableArray`1& implicitlyInitializedFieldsOpt, Boolean requireOutParamsAssigned)
      at Microsoft.CodeAnalysis.CSharp.FlowAnalysisPass.Rewrite(MethodSymbol method, BoundBlock block, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics, Boolean hasTrailingExpression, Boolean originalBodyNested)
      at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileMethod(MethodSymbol methodSymbol, Int32 methodOrdinal, ProcessedFieldInitializers& processedInitializers, SynthesizedSubmissionFields previousSubmissionFields, TypeCompilationState compilationState)
      at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileNamedType(NamedTypeSymbol containingType)
      at Microsoft.CodeAnalysis.CSharp.MethodCompiler.<>c__DisplayClass25_0.<CompileNamedTypeAsync>b__0()
      at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)

Somehow they're either ending up witha null container in definite assignment, or a non-c# symbol (probably the former).