roslyn: VS 2017.15.5.2 crash during 'Rename' operation (of an enum value)

Hi,

I open a solution with 14 projects (13 C#/ 1 F#, .NET Framework 4.7), go to a file with a enum, press CTRL+R,R to rename an enum value then VS starts thinking and crashes. Callstack from Event Viewer:

Application: devenv.exe Framework Version: v4.0.30319 Description: The application requested process termination through System.Environment.FailFast(string message). Message: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver.Session.<FindDocumentsAndPossibleNameConflicts>d__24.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.Action1&lt;System.Exception&gt;) at Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportUnlessCanceled(System.Exception) at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session+&lt;FindDocumentsAndPossibleNameConflicts&gt;d__24.MoveNext() at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session+&lt;FindDocumentsAndPossibleNameConflicts&gt;d__24.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session+&lt;FindDocumentsAndPossibleNameConflicts&gt;d__24, Microsoft.CodeAnalysis.Workspaces, Version=2.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](&lt;FindDocumentsAndPossibleNameConflicts&gt;d__24 ByRef) at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session.FindDocumentsAndPossibleNameConflicts() at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session+&lt;ResolveConflictsAsync&gt;d__18.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session+<ResolveConflictsAsync>d__18, Microsoft.CodeAnalysis.Workspaces, Version=2.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ResolveConflictsAsync>d__18 ByRef) at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session.ResolveConflictsAsync() at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver.ResolveConflictsAsync(Microsoft.CodeAnalysis.Rename.RenameLocations, System.String, System.String, Microsoft.CodeAnalysis.Options.OptionSet, System.Func2&lt;System.Collections.Generic.IEnumerable1<Microsoft.CodeAnalysis.ISymbol>,System.Nullable1&lt;Boolean&gt;&gt;, System.Threading.CancellationToken) at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.AbstractEditorInlineRenameService+InlineRenameLocationSet+&lt;GetReplacementsAsync&gt;d__7.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.AbstractEditorInlineRenameService+InlineRenameLocationSet+<GetReplacementsAsync>d__7, Microsoft.CodeAnalysis.EditorFeatures, Version=2.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<GetReplacementsAsync>d__7 ByRef) at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.AbstractEditorInlineRenameService+InlineRenameLocationSet.GetReplacementsAsync(System.String, Microsoft.CodeAnalysis.Options.OptionSet, System.Threading.CancellationToken) at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession+<>c__DisplayClass62_0.<UpdateConflictResolutionTask>b__0(System.Threading.Tasks.Task1&lt;Microsoft.CodeAnalysis.Editor.IInlineRenameLocationSet&gt;) at Roslyn.Utilities.TaskExtensions+&lt;&gt;c__DisplayClass16_02[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<SafeContinueWithFromAsync>b__0(System.Threading.Tasks.Task) at System.Threading.Tasks.ContinuationResultTaskFromTask`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.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/167118/vs-201751-crash-during-rename-operation-of-an-enum.html VSTS ticketId: 537912 These are the original issue comments:

Phillip Carter [MSFT] on 12/16/2017, 02:14 PM (4 days ago):

Hello Cyril,


Did you invoke rename on an F# enum or a C# enum? Are the enums consumed by other languages? (e.g., C# enum –> used by F#, or F# enum –> used by C#)

Cyril Andreichuk on 12/18/2017, 01:42 AM (2 days ago):

hi,

1) it’s C# enum (have you checked the attached files? you can see it there 😃)

2) the enum is not used in F# code. F# project references the project with the enum.

3) the issue can be reproduced on VS 15.5.2

Phillip Carter [MSFT] on 12/18/2017, 08:31 AM (2 days ago):

Thank you for the info! I work on the F# team, so I wanted to reach out about this before routing the bug to the appropriate team. It seems our system saw “F#” in the report and routed it my direction. I’ll direct this to the C# IDE team.

These are the original issue solutions: (no solutions)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

@loop-evgeny Sorry if I missed it, but does your scenario match the F# one described in the top post (F# project referencing the C# project) that should have been fixed with https://github.com/dotnet/roslyn/pull/28789?

@jinujoseph Regardless, can we discuss @loop-evgeny 's point about exception handling in general in this and other IDE features? I’ve filed https://github.com/dotnet/roslyn/issues/29262 for this purpose.