roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

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

Open vsfeedback opened this issue 1 year ago • 2 comments

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)

vsfeedback avatar Aug 27 '24 17:08 vsfeedback

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).

CyrusNajmabadi avatar Aug 27 '24 17:08 CyrusNajmabadi

@CyrusNajmabadi How did you get this stack trace? It seems really wacky, as it shows SyntaxNode.get_Location() calling CSharpCompilation.CommonCreateErrorTypeSymbol(...), which I can't make sense of.

jcouv avatar Nov 26 '24 23:11 jcouv

@CyrusNajmabadi How did you get this stack trace? It seems really wacky, as it shows SyntaxNode.get_Location() calling CSharpCompilation.CommonCreateErrorTypeSymbol(...), which I can't make sense of.

That frame is likely a glitch. But the rest looks good

CyrusNajmabadi avatar Nov 27 '24 03:11 CyrusNajmabadi

I recently got into a very similar situation. I'm not sure if the stack trace is the same, but otherwise the errors listed are exactly the same. Unfortunately, I didn't really have time to debug it too much. I found it was caused by a particular line of code in my application. I changed said line in Notepad, after which I no longer received the error. Unfortunately, I can't share the contents of the code base in question, I asked, but my boss said no. I did convince them to allow me to share the full application dump of "ServiceHub.RoslynCodeAnalysisService.exe.25696.dmp", which probably contains the entirety of the code base it was analyzing in the first place, but I'm not going to tell them that. It's about 600mb, if you are interested, let me know and I'll post it somewhere. I understand if It's not enough to go on by itself. I've solved the problem for myself, but if I can help you guys find bugs, I'll do what I can.

kirk56k avatar Mar 27 '25 13:03 kirk56k