Skip to content

OOP crash with ArgumentNullException in BodyLevelSymbolKey.Resolve #44477

@mavasani

Description

@mavasani

Version Used:
Microsoft Visual Studio Enterprise 2019 Int Preview
Version 16.7.0 Preview 2.0 [30118.8.master]
VisualStudio.16.IntPreview/16.7.0-pre.2.0+30118.8.master

Steps to Reproduce:

Got a service hub crash while refactoring code with compiler errors:

StreamJsonRpc.RemoteInvocationException : Value cannot be null.
Parameter name: syntaxTree
   at async StreamJsonRpc.JsonRpc.InvokeCoreAsync[TResult](<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Remote.RemoteEndPoint.InvokeAsync(<Unknown Parameters>)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
---> (Remote Exception) {
  "type": "System.ArgumentNullException",
  "message": "Value cannot be null.\r\nParameter name: syntaxTree",
  "stack": "   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetSemanticModel(SyntaxTree syntaxTree, Boolean ignoreAccessibility)\r\n
   at Microsoft.CodeAnalysis.SymbolKey.BodyLevelSymbolKey.Resolve(SymbolKeyReader reader)\r\n   at Microsoft.CodeAnalysis.SymbolKey.SymbolKeyReader.ReadWorker(SymbolKeyType type)\r\n
   at Microsoft.CodeAnalysis.SymbolKey.SymbolKeyReader.ReadSymbolKey()\r\n
   at Microsoft.CodeAnalysis.SymbolKey.ResolveString(String symbolKey, Compilation compilation, Boolean ignoreAssemblyKey, CancellationToken cancellationToken)\r\n
   at Microsoft.CodeAnalysis.Remote.SerializableSymbolAndProjectId.<TryRehydrateAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.CodeAnalysis.Remote.CodeAnalysisService.<>c__DisplayClass36_0.<<FindReferencesAsync>b__0>d.MoveNext()\r\n
--- End of stack trace from previous location where exception was thrown ---\r\n
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.CodeAnalysis.Remote.ServiceBase.<RunServiceAsync>d__15.MoveNext()\r\n
--- End of stack trace from previous location where exception was thrown ---\r\n
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)",
  "code": -2147467261,
  "inner": null
} <--- 

Metadata

Metadata

Labels

Area-IDEBugResolution-FixedThe bug has been fixed and/or the requested behavior has been implemented

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions