When using Ctrl+Shift+Space within the argument list of a static generic method to list overloads, VS always crashes.
Repro steps:
git clone https://github.com/Microsoft/vs-streamjsonrpc.git
cd vs-streamjsonrpc
src\streamjsonrpc.sln
In VS, open the JsonRpcProxyGenerationTests.cs file.
On line 30:
this.clientRpc = JsonRpc.Attach<IServer>(this.clientStream);
Place your caret on at the start of clientStream and press Ctrl+Shift+Space to list overloads.
Crash.
Application: devenv.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Microsoft.CodeAnalysis.SignatureHelp.AbstractSignatureHelpProvider.Filter(IList`1 items, IEnumerable`1 parameterNames, Nullable`1 selectedItem)
at Microsoft.CodeAnalysis.SignatureHelp.AbstractSignatureHelpProvider.CreateSignatureHelpItems(IList`1 items, TextSpan applicableSpan, SignatureHelpState state, Nullable`1 selectedItem)
at Microsoft.CodeAnalysis.CSharp.SignatureHelp.InvocationExpressionSignatureHelpProvider.<GetItemsWorkerAsync>d__5.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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.CodeAnalysis.SignatureHelp.AbstractSignatureHelpProvider.<GetItemsAsync>d__15.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.IntelliSense.SignatureHelp.Controller.Session.<ComputeItemsAsync>d__9.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.ReportUnlessCanceled(System.Exception)
at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+<ComputeItemsAsync>d__9.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+<ComputeItemsAsync>d__9.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.ValueTuple`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+<ComputeItemsAsync>d__9, Microsoft.CodeAnalysis.EditorFeatures, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ComputeItemsAsync>d__9 ByRef)
at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session.ComputeItemsAsync(System.Collections.Immutable.ImmutableArray`1<Microsoft.CodeAnalysis.SignatureHelp.ISignatureHelpProvider>, Microsoft.VisualStudio.Text.SnapshotPoint, Microsoft.CodeAnalysis.SignatureHelp.SignatureHelpTriggerInfo, Microsoft.CodeAnalysis.Document, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+<ComputeModelInBackgroundAsync>d__4.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+<ComputeModelInBackgroundAsync>d__4, Microsoft.CodeAnalysis.EditorFeatures, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ComputeModelInBackgroundAsync>d__4 ByRef)
at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session.ComputeModelInBackgroundAsync(Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Model, System.Collections.Immutable.ImmutableArray`1<Microsoft.CodeAnalysis.SignatureHelp.ISignatureHelpProvider>, Microsoft.VisualStudio.Text.SnapshotPoint, Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.DisconnectedBufferGraph, Microsoft.CodeAnalysis.SignatureHelp.SignatureHelpTriggerInfo, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+<>c__DisplayClass3_0.<ComputeModel>b__0(Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Model, System.Threading.CancellationToken)
at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.ModelComputation`1+<>c__DisplayClass17_0[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<ChainTaskAndNotifyControllerWhenFinished>b__0(System.Threading.Tasks.Task`1<System.__Canon>)
at Roslyn.Utilities.TaskExtensions+<>c__DisplayClass15_0`2[[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/385276/abstractsignaturehelpprovider-crashes-vs-when-list.html
VSTS ticketId: 731684_
_These are the original issue comments:_
(no comments)
_These are the original issue solutions:_
(no solutions)
Another hit here in P1: https://developercommunity.visualstudio.com/content/problem/390031/ide-crashes.html.
I'm hitting this today when typing a close parenthesis with the cursor on the end of the second line:

Let me know if an additional dump would be useful and I'll try to repro again.
@jnm2 Just hit this as well.
@mavasani can you take a look?
Also, this is a full VS crash, not a goldbar. Tagging @jinujoseph as well
I have a consistent repro on 16-p1.1 by typing RegexOptions.Multiline here:
using System.Text.RegularExpressions;
class C
{
void M()
{
Regex.Split("", "", [||]);
}
}
Sometimes it freezes when I type the final s of RegexOptions, sometimes when I type the final e of Multiline. Typing fast seems to help.
The entire UI freezes for ~10 seconds, then it crashes to the desktop. I have the same stack trace in Event Viewer.
I hit this multiple times a day. The workaround for me is to hit Ctrl+S a lot, and when typing a StringComparison I just hit Esc to close IntelliSense and type it in manually, like a cave man.
I just hit Esc to close IntelliSense and type it in manually
Ah, this is better than typing in a blank line to autocomplete and then cutting and pasting.
Investigating...
I believe this is fixed in preview2 https://github.com/dotnet/roslyn/pull/30997
cc @genlu for confirmation
From the stack trace it looks like the bug I fixed.
@davidwengier @jnm2 @CyrusNajmabadi Could you guys try deploying from master and see if the issue goes away?
Ah great. Thanks!