Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractSignatureHelpProvider crashes VS when listing overloads of generic methods #31263

Closed
vsfeedback opened this issue Nov 19, 2018 · 13 comments
Assignees
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Resolution-Duplicate The described behavior is tracked in another issue Tenet-Reliability Customer telemetry indicates that the product is failing in a crash/hang/dataloss manner.
Milestone

Comments

@vsfeedback
Copy link

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.&lt;GetItemsWorkerAsync&gt;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.&lt;GetItemsAsync&gt;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.&lt;ComputeItemsAsync&gt;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&lt;System.Exception&gt;)
   at Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportUnlessCanceled(System.Exception)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+&lt;ComputeItemsAsync&gt;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+&lt;ComputeItemsAsync&gt;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+&lt;ComputeItemsAsync&gt;d__9, Microsoft.CodeAnalysis.EditorFeatures, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](&lt;ComputeItemsAsync&gt;d__9 ByRef)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session.ComputeItemsAsync(System.Collections.Immutable.ImmutableArray`1&lt;Microsoft.CodeAnalysis.SignatureHelp.ISignatureHelpProvider&gt;, Microsoft.VisualStudio.Text.SnapshotPoint, Microsoft.CodeAnalysis.SignatureHelp.SignatureHelpTriggerInfo, Microsoft.CodeAnalysis.Document, System.Threading.CancellationToken)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+&lt;ComputeModelInBackgroundAsync&gt;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+&lt;ComputeModelInBackgroundAsync&gt;d__4, Microsoft.CodeAnalysis.EditorFeatures, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](&lt;ComputeModelInBackgroundAsync&gt;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&lt;Microsoft.CodeAnalysis.SignatureHelp.ISignatureHelpProvider&gt;, 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+&lt;&gt;c__DisplayClass3_0.&lt;ComputeModel&gt;b__0(Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Model, System.Threading.CancellationToken)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.ModelComputation`1+&lt;&gt;c__DisplayClass17_0[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].&lt;ChainTaskAndNotifyControllerWhenFinished&gt;b__0(System.Threading.Tasks.Task`1&lt;System.__Canon&gt;)
   at Roslyn.Utilities.TaskExtensions+&lt;&gt;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]].&lt;SafeContinueWithFromAsync&gt;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)

@sharwell sharwell added Bug Area-IDE Tenet-Reliability Customer telemetry indicates that the product is failing in a crash/hang/dataloss manner. Developer Community The issue was originally reported on https://developercommunity.visualstudio.com labels Nov 20, 2018
@sharwell sharwell added this to the 16.0.P2 milestone Nov 20, 2018
@davkean
Copy link
Member

davkean commented Nov 23, 2018

@jinujoseph jinujoseph assigned ryzngard and mavasani and unassigned ryzngard Nov 23, 2018
@davidwengier
Copy link
Contributor

I'm hitting this today when typing a close parenthesis with the cursor on the end of the second line:

image

Let me know if an additional dump would be useful and I'll try to repro again.

@CyrusNajmabadi
Copy link
Member

@jnm2 Just hit this as well.

@CyrusNajmabadi
Copy link
Member

@mavasani can you take a look?

@CyrusNajmabadi
Copy link
Member

Also, this is a full VS crash, not a goldbar. Tagging @jinujoseph as well

@jnm2
Copy link
Contributor

jnm2 commented Dec 13, 2018

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.

@davidwengier
Copy link
Contributor

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.

@jnm2
Copy link
Contributor

jnm2 commented Dec 13, 2018

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.

@mavasani
Copy link
Contributor

Investigating...

@jinujoseph
Copy link
Contributor

jinujoseph commented Dec 13, 2018

I believe this is fixed in preview2 #30997
cc @genlu for confirmation

@genlu
Copy link
Member

genlu commented Dec 13, 2018

From the stack trace it looks like the bug I fixed.

@genlu
Copy link
Member

genlu commented Dec 13, 2018

@davidwengier @jnm2 @CyrusNajmabadi Could you guys try deploying from master and see if the issue goes away?

@CyrusNajmabadi
Copy link
Member

Ah great. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Resolution-Duplicate The described behavior is tracked in another issue Tenet-Reliability Customer telemetry indicates that the product is failing in a crash/hang/dataloss manner.
Projects
None yet
Development

No branches or pull requests

10 participants