roslyn: How do i debug Compiler Crashes? csc.exe exited with code -2146232797

Hi Guys,

i have already spent 2 days figuring out how to report this bug. During compilation my compiler Crashes. I am using the VS 15.7.3

image

And when i compile my code. This happens: image 2 seconds later another error pops up: image

Visual Studio Output: Microsoft.CSharp.Core.targets(52, 5): [MSB6006] “csc.exe” exited with code -2146232797.

I created a dump and could extract some info:

OnFatalException():19, FailFast (Microsoft.CodeAnalysis)@Microsoft.CodeAnalysis.dll ReportUnlessCanceled():58, FatalError (Microsoft.CodeAnalysis)@Microsoft.CodeAnalysis.dll <CompileNamedTypeAsTask>b__0():206, <>c__DisplayClass21_0 (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll HadLambdaConversionError():475, OverloadResolutionResult1 (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll ReportDiagnostics():127, OverloadResolutionResult1 (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll ReportDelegateMethodGroupDiagnostics():123, Conversions (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll GenerateImplicitConversionError():16454, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll CreateReturnConversion():16871, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll CreateBlockFromExpression():17047, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindLambdaExpressionAsBlock():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll ReallyBind():0, UnboundLambdaState (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll Bind():0, UnboundLambdaState (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll IsAnonymousFunctionCompatibleWithDelegate():0, ConversionsBase (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll IsAnonymousFunctionCompatibleWithExpressionTree():0, ConversionsBase (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll HasAnonymousFunctionConversion():0, ConversionsBase (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll ClassifyImplicitBuiltInConversionFromExpression():0, ConversionsBase (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll ClassifyImplicitConversionFromExpression():0, ConversionsBase (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll IsApplicable():2494, OverloadResolution (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll IsApplicable():0, OverloadResolution (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll IsMemberApplicableInNormalForm():0, OverloadResolution (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll AddMemberToCandidateSet():0, OverloadResolution (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll PerformMemberOverloadResolution():0, OverloadResolution (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll ResolveDefaultMethodGroup():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll ResolveMethodGroupInternal():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll ResolveMethodGroup():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindMethodGroupInvocation():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindInvocationExpression():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindInvocationExpression():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindExpressionInternal():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindArgumentExpression():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindArgumentAndName():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindInvocationExpression():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindExpressionInternal():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindExpression():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindReturn():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindStatement():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindBlockParts():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindStatement():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindPossibleEmbeddedStatement():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindIfStatement():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindStatement():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindBlockParts():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindStatement():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindPossibleEmbeddedStatement():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindIfStatement():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindStatement():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindBlockParts():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindStatement():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindMethodBody():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindMethodBody():0, Binder (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll BindMethodBody():0, MethodCompiler (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll CompileMethod():0, MethodCompiler (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll CompileNamedType():0, MethodCompiler (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll <CompileNamedTypeAsTask>b__0():0, <>c__DisplayClass21_0 (Microsoft.CodeAnalysis.CSharp)@Microsoft.CodeAnalysis.CSharp.dll <WithCurrentUICulture>b__0():0, <>c__DisplayClass5_0 (Roslyn.Utilities)@Microsoft.CodeAnalysis.dll Execute():0, Task (System.Threading.Tasks)@mscorlib.dll RunInternal():0, ExecutionContext (System.Threading)@mscorlib.dll Run():278, ExecutionContext (System.Threading)@mscorlib.dll ExecuteWithThreadLocal():0, Task (System.Threading.Tasks)@mscorlib.dll ExecuteEntry():0, Task (System.Threading.Tasks)@mscorlib.dll Dispatch():0, ThreadPoolWorkQueue (System.Threading)@mscorlib.dll Native to Managed Transition:0, ()@

I would like to give more info, but it’s really hard to get more insight. Unfortunately, i can’t share my code. ( it’s enterprise code and it’s huge)¨ I would like to report a proper minimal example. But i am unable to do so, because i don’t know what exactly it causes. Do you have any tipps, how i can debug this?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 20 (12 by maintainers)

Most upvoted comments

@epoyraz I suggest debugging the issue as follows:

  1. Create a git repository that is a clone of https://github.com/dotnet/roslyn
  2. In a “Developer Command Prompt for VS 2017”, do the following: a. cd Roslyn (or wherever your git clone of Roslyn is) b. Restore.cmd
  3. Open Roslyn.sln in VS 2017
  4. Hit F6 to Build (or, alternatively, type MSBuild /m Roslyn.sln in the command prompt)
  5. Set “Visual Studio Setup” as your startup project (in the Solution Explorer, under the Visual Studio folder)
  6. hit F5 to Start Visual Studio with your new Roslyn under the debugger
  7. In the new Visual Studio that pops up, open your solution that exhibits the problem.
  8. Reproduce the problem. You will now be in a position to debug it.

Please let us know if you can do this, and if so what you learn.

This might be obvious to some but you must install donnet-sdk-2.1.200-rtm-00-88-66… before step 4, and F6 does nothing on my version of VS but I can use VS Menus or Ctrl+Shift+B to build.