Skip to content

VS 2017 crashes: unhandled exception in Microsoft.VisualStudio.Package.Colorizer.GetLineInfo() #2589

@SirEel

Description

@SirEel

Repro steps

Installed VS 2017 RTM with F# language chosen. Additionally installed Desktop, ASP.NET, ASP.NET Core, Data, and Azure workflows.

I always use Tools-Options to change the font in text editor and FSI to DejaVu Sans Mono instead of the default Consolas. This worked fine in VS 2015. I also customize the text editor's background color when using the Blue color scheme, but I've encountered same problems below when using other color schemes with default colors. I don't know if these settings are causing the problem, but the error messages trace to Microsoft.VisualStudio.Package.Colorizer.

I haven't used VS 2017 for anything except creating FSX scripts and executing them in FSI. So I don't know if this is an F#-specific problem. But the error messages indicate it's coming from "an editor or extension".

Expected behavior

No errors, no crashing

Actual behavior

Problem #1:
At seemingly random moments Visual Studio pops up an error that says, "An exception has been encountered. This may be caused by an extension. You can get more information by examining the file at C:\users\ ... \ActivityLog.xml"

In ActivityLog.xml I find:

714 2017/03/11 19:46:24.763 Error Editor or Editor Extension System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at Microsoft.VisualStudio.Package.Colorizer.GetLineInfo(IVsTextLines buffer, Int32 line, IVsTextColorState colorState) at Microsoft.VisualStudio.Package.Source.GetWordExtent(Int32 line, Int32 idx, WORDEXTFLAGS flags, Int32& startIdx, Int32& endIdx) at Microsoft.VisualStudio.Package.ViewFilter.GetWordExtent(Int32 line, Int32 index, UInt32 flags, TextSpan[] span) at Microsoft.VisualStudio.Editor.Implementation.SimpleTextViewWindow.GetWordExtent(Int32 iLine, Int32 iCol, UInt32 dwFlags, TextSpan[] pSpan) at Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource.TryGetQuickInfoFromDebugger(IQuickInfoSession session, TextSpan[] dataBufferTextSpan, String& tipText) at Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource.AugmentQuickInfoSession(IQuickInfoSession session, IList`1 qiContent, ITrackingSpan& applicableToSpan) at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Recalculate() at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Start() at Microsoft.VisualStudio.Language.Intellisense.Implementation.DefaultQuickInfoController.OnTextView_MouseHover(Object sender, MouseHoverEventArgs e) at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.RaiseHoverEvents()

This does not stop Visual Studio once I close the error dialog, so I continue working.

But then ...

Problem #2:
At seemingly random moments, Visual Studio crashes. Windows 10 pops up and says "This program has encountered an error and will restart." It restarts. The event log says:

Application: devenv.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.Runtime.InteropServices.COMException at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32, IntPtr) at Microsoft.VisualStudio.Package.Colorizer.GetLineInfo(Microsoft.VisualStudio.TextManager.Interop.IVsTextLines, Int32, Microsoft.VisualStudio.TextManager.Interop.IVsTextColorState) at Microsoft.VisualStudio.Package.Source.GetWordExtent(Int32, Int32, Microsoft.VisualStudio.TextManager.Interop.WORDEXTFLAGS, Int32 ByRef, Int32 ByRef) at Microsoft.VisualStudio.Package.ViewFilter.GetWordExtent(Int32, Int32, UInt32, Microsoft.VisualStudio.TextManager.Interop.TextSpan[]) at Microsoft.VisualStudio.Editor.Implementation.SimpleTextViewWindow.GetWordExtent(Int32, Int32, UInt32, Microsoft.VisualStudio.TextManager.Interop.TextSpan[]) at Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource.TryGetQuickInfoFromDebugger(Microsoft.VisualStudio.Language.Intellisense.IQuickInfoSession, Microsoft.VisualStudio.TextManager.Interop.TextSpan[], System.String ByRef) at Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource.AugmentQuickInfoSession(Microsoft.VisualStudio.Language.Intellisense.IQuickInfoSession, System.Collections.Generic.IList`1<System.Object>, Microsoft.VisualStudio.Text.ITrackingSpan ByRef) at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Recalculate() at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Start() at Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource+<>c__DisplayClass12_0.b__0(System.Object, System.EventArgs) at System.Windows.Threading.DispatcherTimer.FireTick(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.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object) at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(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.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(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)

Known workarounds

None

Related information

  • Operating system
    Windows 10
  • Branch
    Whatever comes with VS 2017 RTM
  • .NET Runtime, CoreCLR or Mono Version
    FSX files executing in FSI
  • Editing Tools (e.g. Visual Studio Version)
    2017 RTM
  • Links to F# RFCs or entries on http://fslang.uservoice.com
    none
  • Links to performance testing scripts
    none
  • Indications of severity
    occurs many times each day

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions