locked
Visual Studio 2015 RC Crashes in C# Project on Source Changes RRS feed

  • Question

  • User30775550 posted

    Since yesterday, October 12th, Visual Studio 2015 RC began spontaneously crashing whenever I make code changes to my C# project.  The project consists of 70 source files; spread across several partial classes.  Here is a stack trace retrieved from the Event Viewer:

    Application: devenv.exe Framework Version: v4.0.30319 Description: The application requested process termination through System.Environment.FailFast(string message). Message: System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: 'Roslyn.Utilities.EnumField+EnumFieldComparer'. at System.Collections.Generic.IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(Object comparer) at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer) at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer`1 comparer) at Microsoft.CodeAnalysis.SymbolDisplay.AbstractSymbolDisplayVisitor`1.GetSortedEnumFields(INamedTypeSymbol enumType, ArrayBuilder`1 enumFields) at Microsoft.CodeAnalysis.SymbolDisplay.AbstractSymbolDisplayVisitor`1.AddNonFlagsEnumConstantValue(INamedTypeSymbol enumType, Object constantValue) at Microsoft.CodeAnalysis.SymbolDisplay.AbstractSymbolDisplayVisitor`1.AddEnumConstantValue(INamedTypeSymbol enumType, Object constantValue, Boolean preferNumericValueOrExpandedFlags) at Microsoft.CodeAnalysis.SymbolDisplay.AbstractSymbolDisplayVisitor`1.AddNonNullConstantValue(ITypeSymbol type, Object constantValue, Boolean preferNumericValueOrExpandedFlagsForEnum) at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.AddConstantValue(ITypeSymbol type, Object constantValue, Boolean preferNumericValueOrExpandedFlagsForEnum) at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.VisitParameter(IParameterSymbol symbol) at Microsoft.CodeAnalysis.CSharp.Symbols.ParameterSymbol.Accept(SymbolVisitor visitor) at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.AddParametersIfRequired(Boolean hasThisParameter, Boolean isVarargs, ImmutableArray`1 parameters) at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.AddParameters(IMethodSymbol symbol) at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.VisitMethod(IMethodSymbol symbol) at Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol.Accept(SymbolVisitor visitor) at Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToDisplayParts(ISymbol symbol, SemanticModel semanticModelOpt, Int32 positionOpt, SymbolDisplayFormat format, Boolean minimal) at Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToDisplayParts(ISymbol symbol, SymbolDisplayFormat format) at Microsoft.CodeAnalysis.CSharp.Symbol.Microsoft.CodeAnalysis.ISymbol.ToDisplayString(SymbolDisplayFormat format) at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.CreateItemForMember(ISymbol member, Int32 symbolIndex, SyntaxTree tree, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.GetMembersInTypes(SyntaxTree tree, IEnumerable`1 types, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.<GetItemsAsync>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController.<ComputeModelAsync>d__30.MoveNext() --- End of inner exception stack trace --- ---> (Inner Exception #0) System.ArgumentException: Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: 'Roslyn.Utilities.EnumField+EnumFieldComparer'. at System.Collections.Generic.IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(Object comparer) at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer) at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer`1 comparer) at Microsoft.CodeAnalysis.SymbolDisplay.AbstractSymbolDisplayVisitor`1.GetSortedEnumFields(INamedTypeSymbol enumType, ArrayBuilder`1 enumFields) at Microsoft.CodeAnalysis.SymbolDisplay.AbstractSymbolDisplayVisitor`1.AddNonFlagsEnumConstantValue(INamedTypeSymbol enumType, Object constantValue) at Microsoft.CodeAnalysis.SymbolDisplay.AbstractSymbolDisplayVisitor`1.AddEnumConstantValue(INamedTypeSymbol enumType, Object constantValue, Boolean preferNumericValueOrExpandedFlags) at Microsoft.CodeAnalysis.SymbolDisplay.AbstractSymbolDisplayVisitor`1.AddNonNullConstantValue(ITypeSymbol type, Object constantValue, Boolean preferNumericValueOrExpandedFlagsForEnum) at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.AddConstantValue(ITypeSymbol type, Object constantValue, Boolean preferNumericValueOrExpandedFlagsForEnum) at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.VisitParameter(IParameterSymbol symbol) at Microsoft.CodeAnalysis.CSharp.Symbols.ParameterSymbol.Accept(SymbolVisitor visitor) at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.AddParametersIfRequired(Boolean hasThisParameter, Boolean isVarargs, ImmutableArray`1 parameters) at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.AddParameters(IMethodSymbol symbol) at Microsoft.CodeAnalysis.CSharp.SymbolDisplayVisitor.VisitMethod(IMethodSymbol symbol) at Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol.Accept(SymbolVisitor visitor) at Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToDisplayParts(ISymbol symbol, SemanticModel semanticModelOpt, Int32 positionOpt, SymbolDisplayFormat format, Boolean minimal) at Microsoft.CodeAnalysis.CSharp.SymbolDisplay.ToDisplayParts(ISymbol symbol, SymbolDisplayFormat format) at Microsoft.CodeAnalysis.CSharp.Symbol.Microsoft.CodeAnalysis.ISymbol.ToDisplayString(SymbolDisplayFormat format) at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.CreateItemForMember(ISymbol member, Int32 symbolIndex, SyntaxTree tree, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.GetMembersInTypes(SyntaxTree tree, IEnumerable`1 types, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Editor.CSharp.NavigationBar.CSharpNavigationBarItemService.<GetItemsAsync>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Editor.Implementation.NavigationBar.NavigationBarController.<ComputeModelAsync>d__30.MoveNext()<--- Stack: at System.Environment.FailFast(System.String, System.Exception) at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception) at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action`1<System.Exception>) at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception) at Roslyn.Utilities.TaskExtensions.ReportFatalErrorWorker(System.Threading.Tasks.Task, System.Object) at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() at System.Threading.Tasks.Task.Execute() at System.Threading.Tasks.Task.ExecutionContextCallback(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) at System.Threading.Tasks.Task.ExecuteEntry(Boolean) at System.Threading.Tasks.ThreadPoolTaskScheduler.TryExecuteTaskInline(System.Threading.Tasks.Task, Boolean) at System.Threading.Tasks.TaskScheduler.TryRunInline(System.Threading.Tasks.Task, Boolean) at System.Threading.Tasks.TaskContinuation.InlineIfPossibleOrElseQueue(System.Threading.Tasks.Task, Boolean) at System.Threading.Tasks.StandardTaskContinuation.Run(System.Threading.Tasks.Task, Boolean) at System.Threading.Tasks.Task.ContinueWithCore(System.Threading.Tasks.Task, System.Threading.Tasks.TaskScheduler, System.Threading.CancellationToken, System.Threading.Tasks.TaskContinuationOptions) at System.Threading.Tasks.Task.ContinueWith(System.Action`2<System.Threading.Tasks.Task,System.Object>, System.Object, System.Threading.Tasks.TaskScheduler, System.Threading.CancellationToken, System.Threading.Tasks.TaskContinuationOptions, System.Threading.StackCrawlMark ByRef) at System.Threading.Tasks.Task.ContinueWith(System.Action`2<System.Threading.Tasks.Task,System.Object>, System.Object, System.Threading.CancellationToken, System.Threading.Tasks.TaskContinuationOptions, System.Threading.Tasks.TaskScheduler) at Roslyn.Utilities.TaskExtensions.ReportFatalError(System.Threading.Tasks.Task, System.Object) at System.Threading.Tasks.ContinuationTaskFromResultTask`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InnerInvoke() at System.Threading.Tasks.Task.Execute() at System.Threading.Tasks.Task.ExecutionContextCallback(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) at System.Threading.Tasks.Task.ExecuteEntry(Boolean) at System.Threading.Tasks.ThreadPoolTaskScheduler.TryExecuteTaskInline(System.Threading.Tasks.Task, Boolean) at System.Threading.Tasks.TaskScheduler.TryRunInline(System.Threading.Tasks.Task, Boolean) at System.Threading.Tasks.TaskContinuation.InlineIfPossibleOrElseQueue(System.Threading.Tasks.Task, Boolean) at System.Threading.Tasks.StandardTaskContinuation.Run(System.Threading.Tasks.Task, Boolean) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task.FinishStageThree() at System.Threading.Tasks.Task.FinishStageTwo() at System.Threading.Tasks.Task.Finish(Boolean) at System.Threading.Tasks.Task`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetException(System.Object) at System.Threading.Tasks.UnwrapPromise`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetFromTask(System.Threading.Tasks.Task, Boolean) at System.Threading.Tasks.UnwrapPromise`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ProcessInnerTask(System.Threading.Tasks.Task) at System.Threading.Tasks.UnwrapPromise`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ProcessCompletedOuterTask(System.Threading.Tasks.Task) at System.Threading.Tasks.UnwrapPromise`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Invoke(System.Threading.Tasks.Task) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task.FinishStageThree() at System.Threading.Tasks.Task.FinishStageTwo() at System.Threading.Tasks.Task.Finish(Boolean) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) at System.Threading.Tasks.Task.ExecuteEntry(Boolean) at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

    Tuesday, October 13, 2015 10:18 AM

All replies

  • User-821857111 posted

    Visual Studio 2015 RC
    You should be using the RTM. It's been available for quite some time. Whatever issue you have encountered may have been fixed in that.

    Tuesday, October 13, 2015 11:15 AM
  • User30775550 posted

    Thank you Mike!

    The problem continued to happen even after I downloaded and reinstalled from the Visual Studio Downloads page at https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx.  Though there was no special mention of the RTM there, I believe that's what I now have.  So, I think this problem is in the RTM as well.

    Visual Studio Community 2015 Version 14.0.23107.0 D14REL.  The DLL's and the executable bear a July 7th date; and the splash screen no longer says RC.  I have .NET Framework Version 4.6.00079.

    Playing with the problematic code a bit, I think the problem may be due to a relatively complex enum, where I have some #if clauses controlling which values get definted within the type.  The stack trace mentions Roslyn; and gives evidence of having run afoul of some threading issue.  Is there a way to disable background compilation?

    Chris

    Tuesday, October 13, 2015 12:09 PM
  • User30775550 posted

    I have managed to reduce this problem to 70 lines of C# in a simple class containing a lengthy Enum.  The code causes VS 2015 to crash.  Now I just have to figure out where to post it so that the VS C# team will have a look into the cause.

    thanks, Chris

    Thursday, October 15, 2015 12:14 PM
  • User-166373564 posted

    Hi Chris,

    Now I just have to figure out where to post it so that the VS C# team will have a look into the cause.

    You could consider submitting this issue to Microsoft Connect Site, our engineers will reproduce this issue according to the proof you provide, and VS team engineers will evaluate this issue seriously, then they will give quick and positive response for you.

    Regards,

    Angie

    Monday, October 26, 2015 7:44 AM
  • User30775550 posted

    Hello Angie,

    I filed this issue on the Microsoft Connect Site via the Feedback [Send a Smile/Frown] mechanism in Visual Studio.  I used the title "C# Class Causes the Visual Studio 2015 Community Release to Crash".  The issue was filed on the 16th; and I received a comment that it is being looked into on the 22nd.

    thank you, Chris

    Friday, October 30, 2015 1:17 AM