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

VS crashing when clicking on Intellisense in Immediate window #24565

Closed
vsccarl opened this issue Jan 31, 2018 · 8 comments
Closed

VS crashing when clicking on Intellisense in Immediate window #24565

vsccarl opened this issue Jan 31, 2018 · 8 comments
Assignees
Labels
Area-Interactive Bug Interactive-Debugging Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented Tenet-Reliability Customer telemetry indicates that the product is failing in a crash/hang/dataloss manner.
Milestone

Comments

@vsccarl
Copy link

vsccarl commented Jan 31, 2018

Version Used:
d15.6\27329.01 with olegtk/FixIntellisenseInImmediate
Roslyn 2.7.0.6252601
Steps to Reproduce:

  1. Create a new VB Console App
  2. Add
Dim number As Integer
number = 5
  1. Set a breakpoint on line 6 End Sub
  2. F5
  3. Open immediate window and start typing num to bring up intellisense
  4. Double click on number in intellisense dialog

Expected Behavior:
The variable is inserted into the immediate window.

Actual Behavior:
VS Crashes

Log:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
   at System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource)
   at System.Collections.Generic.Queue`1[[Microsoft.VisualStudio.Text.SnapshotSpan, Microsoft.VisualStudio.Text.Data, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].Dequeue()
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.DisconnectedBufferGraph.MapDownToSnapshot(Microsoft.VisualStudio.Text.Span, Microsoft.VisualStudio.Text.Projection.IProjectionSnapshot, Microsoft.VisualStudio.Text.ITextSnapshot)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.DisconnectedBufferGraph.GetSubjectBufferTextSpanInViewBuffer(Microsoft.CodeAnalysis.Text.TextSpan)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Controller.SetCaretPosition(Int32)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Controller.Commit(Microsoft.CodeAnalysis.Completion.CompletionItem, Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Model, System.Nullable`1<Char>, Microsoft.VisualStudio.Text.ITextSnapshot, System.Action)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Controller.CommitItem(Microsoft.CodeAnalysis.Completion.CompletionItem)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Controller+Session.OnPresenterSessionItemCommitted(System.Object, Microsoft.CodeAnalysis.Editor.CompletionItemEventArgs)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.CompletionPresenterSession.OnCompletionItemCommitted(Microsoft.CodeAnalysis.Completion.CompletionItem)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.CustomCommitCompletion.Commit()
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CompletionSession.Commit()
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.DefaultCompletionSetPresenter.OnListBox_MouseDoubleClick(System.Object, System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
   at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs)
   at System.Windows.Controls.Control.OnMouseDoubleClick(System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.Controls.Control.HandleDoubleClick(System.Object, System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
   at System.Windows.UIElement.OnMouseDownThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
   at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
   at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
   at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
@olegtk
Copy link
Contributor

olegtk commented Jan 31, 2018

Note: it also repros in VS 15.5 so it's not a recent regression.

@jinujoseph jinujoseph added this to the 15.8 milestone Feb 1, 2018
@jinujoseph jinujoseph modified the milestones: 15.8, Unknown Jun 7, 2018
@sharwell sharwell added the Tenet-Reliability Customer telemetry indicates that the product is failing in a crash/hang/dataloss manner. label Jun 12, 2018
@sharwell sharwell modified the milestones: Unknown, 15.8 Jun 12, 2018
@sharwell
Copy link
Member

📝 Make sure to enable the corresponding test from #25814 when this is fixed.

@AmadeusW
Copy link
Contributor

When user presses Tab, the edit comes out fine. When user double-clicks the item, the base buffer (containing "num") is read only, and no edit is made. I will continue investigating this.

@AmadeusW
Copy link
Contributor

First thing that happens when user presses Tab is removing the ReadOnly flag in DebuggerIntellisenseFilter.ExecuteVisualStudio2000

We actually remove this flag pretty frequently (every time user types), but just before user clicks on the completion item, the flag is set to true

@AmadeusW
Copy link
Contributor

The read only flag is set to true in src\env\msenv\core\cmdwin.cpp when we return from InternalExec({5efc7975-14bc-11cf-9b2b-00aa00573819}, 770, 0, 0x00000000, 0x00000000), in the destructor of CAutoReadOnlySetter: src\env\inc\AutoReadOnlySetter.h:42

I'm not sure what this is and why this is being called, but the Tab handler explicitly removes the ReadOnly flag, while the Click handler does not.

A possible fix would be to reset the read only flag of the buffer when handling the click event in intellisense

@tmat
Copy link
Member

tmat commented Jun 28, 2018

@AmadeusW Your help with figuring this out is appreciated.

@tmat
Copy link
Member

tmat commented Jun 30, 2018

Fixed by #28131

@sharwell sharwell added the Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented label Jul 3, 2018
@sharwell
Copy link
Member

sharwell commented Jul 8, 2018

📝 Make sure to enable the corresponding test from #25814 when this is fixed.

@tmat 😑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Interactive Bug Interactive-Debugging Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented 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

7 participants