visual studio crashes randomly devenv KERNELBASE.dll

0

My Visual Studio crashes randomly. Event Viewer shows the following error

Faulting application name: devenv.exe, version: 12.0.40629.0, time stamp: 0x5590c8a4

Faulting module name: KERNELBASE.dll, version: 10.0.15063.674, time stamp: 0x6d16dd24

Exception code: 0xe0434352

Fault offset: 0x000eb872

Faulting process id: 0x3b00

Faulting application start time: 0x01d34ecf7a049150

Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe

Faulting module path: C:\Windows\System32\KERNELBASE.dll

Report Id: xxxxxxxx-867c-4c54-b259-c28a7b9d8151

Faulting package full name: Faulting package-relative application ID:

I have tried running devenv /SAFEMODE command at (C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE)

but still it keeps occuring and sometimes a dialog box also appears "not enough storage available"

Application: devenv.exe

Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: System.ComponentModel.Win32Exception at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D)

Activity Log

(0x80004005): Not enough storage is available to process this command

at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d)

at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)

at System.Windows.Interop.HwndSource.Initialize(HwndSourceParameters parameters)

at System.Windows.Interop.HwndSource..ctor(HwndSourceParameters parameters)

at System.Windows.Controls.Primitives.Popup.PopupSecurityHelper.BuildWindow(Int32 x, Int32 y, Visual placementTarget, Boolean transparent, HwndSourceHook hook, AutoResizedEventHandler handler)

at System.Windows.Controls.Primitives.Popup.BuildWindow(Visual targetVisual)

at System.Windows.Controls.Primitives.Popup.CreateWindow(Boolean asyncCall)

at System.Windows.Controls.Primitives.Popup.OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)

at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)

at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)

at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)

at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)

at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)

at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)

at Microsoft.VisualStudio.Language.Intellisense.Implementation.MouseTrackingQuickInfoPresenter.Render()

at Microsoft.VisualStudio.Language.Intellisense.Implementation.IntellisenseSessionStack.OnSessionPresenterChanged(Object sender, EventArgs e)

at Microsoft.VisualStudio.Language.Intellisense.Implementation.IntellisenseSession.RaisePresenterChanged()

at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Recalculate()

at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Start()

at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoBroker.TriggerQuickInfo(ITextView textView, ITrackingPoint triggerPoint, Boolean trackMouse)

at Microsoft.Html.Editor.HtmlQuickInfoController.OnMouseHover(Object sender, MouseHoverEventArgs e)

at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.RaiseHoverEvents()

UPDATE

My Application runs for once or twice in safemode then even that exits. When trying to restart visual studio, it fails. Then event viewer or cmd prompt do not work and i have to restart my machine to make something work.

UPDATE 2

Looks like this and this is my issue. Now How do i use Dispatcher in my code?

public string ConvertRtfToHtml(string rtfText)
    {

        try
        {
            var thread = new Thread(ConvertRtfInSTAThread);                
            var threadData = new ConvertRtfThreadData { RtfText = rtfText };
            thread.SetApartmentState(ApartmentState.STA);
            thread.Start(threadData);

            try
            {
                thread.Join();
            }
            catch(ThreadStateException e){
                logger.Error("ThreadStateException " + e.Message);
            }
            catch (ThreadInterruptedException e) {
                logger.Error("ThreadInterruptedException " + e.Message);
            }                


            return threadData.HtmlText;

        }
        catch (Exception e){
            logger.Error("ConvertRtfToHtml: " + e.InnerException.Message);
            return "Error";
        }

    }

the ConvertRtfToHtml is being called from within a loop the ConvertRtfInSTAThread uses a RichTextBox control

visual-studio-2013
threadpool
richtext
win32-process
asked on Stack Overflow Oct 29, 2017 by Samra • edited Nov 1, 2017 by Samra

1 Answer

-1

after lots of trial and errors i found the root cause was this. Here is my implementation.

answered on Stack Overflow Nov 3, 2017 by Samra

User contributions licensed under CC BY-SA 3.0