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

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

Open
vsfeedback opened this issue Aug 27, 2024 · 4 comments
Assignees
Milestone

Comments

@vsfeedback
Copy link

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)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 27, 2024
@CyrusNajmabadi
Copy link
Member

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 CyrusNajmabadi added this to the 17.13 milestone Nov 26, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged Issues and PRs which have not yet been triaged by a lead label Nov 26, 2024
@jcouv
Copy link
Member

jcouv commented Nov 26, 2024

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

@CyrusNajmabadi
Copy link
Member

@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

@kirk56k
Copy link

kirk56k commented Mar 27, 2025

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.

@jaredpar jaredpar modified the milestones: 17.13, Backlog Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
@jaredpar @CyrusNajmabadi @jcouv @vsfeedback @kirk56k and others