Link to home
Start Free TrialLog in
Avatar of Spike UK
Spike UKFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Application crash due to KERNELBASE.dll possibly?

I have written an application that runs as a Windows Desktop application , running on a windows 10 laptop that occasionally crashes. The crash may happen after 24 hours, maybe 60 hours - maybe longer, sometimes not at all.
The Widows Event Viewer shows that the application crash was preceded by an Error from the ,Net Runtime- at around a minute before athe application is reported to have crashed.

Is this an application error or due to the KERNELBASE.dll? Or something else!

The details of the error are:

Log Name:      Application
Source:        Application Error
Date:          24/09/2018 01:20:16
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      C-035
Description:
Faulting application name: MyApplication.exe, version: 2.0.7.10, time stamp: 0x5ba4b1a1
Faulting module name: KERNELBASE.dll, version: 10.0.17134.1, time stamp: 0x149ab0fd
Exception code: 0xe0434352
Fault offset: 0x0010d722
Faulting process ID: 0x1958
Faulting application start time: 0x01d451f2970b38f1
Faulting application path: C:\Program Files\Company1\MyApplication.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report ID: 212dc380-af79-47ed-9362-dc496bd13999
Faulting package full name:
Faulting package-relative application ID:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>100</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2018-09-24T00:20:16.266166000Z" />
    <EventRecordID>4323</EventRecordID>
    <Channel>Application</Channel>
    <Computer>C-035</Computer>
    <Security />
  </System>
  <EventData>
    <Data>MyApplication.exe</Data>
    <Data>2.0.7.10</Data>
    <Data>5ba4b1a1</Data>
    <Data>KERNELBASE.dll</Data>
    <Data>10.0.17134.1</Data>
    <Data>149ab0fd</Data>
    <Data>e0434352</Data>
    <Data>0010d722</Data>
    <Data>1958</Data>
    <Data>01d451f2970b38f1</Data>
    <Data>C:\Program Files\Company1\MyApplication.exe</Data>
    <Data>C:\Windows\System32\KERNELBASE.dll</Data>
    <Data>212dc380-af79-47ed-9362-dc496bd13999</Data>
    <Data>
    </Data>
    <Data>
    </Data>
  </EventData>
</Event>

and the detailed view is:

Application: MyApplication.exe Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.
ExternalException at System.Drawing.Graphics.MeasureString(System.String, System.Drawing.Font, System.Drawing.SizeF, System.Drawing.StringFormat)
      at System.Drawing.Graphics.MeasureString(System.String, System.Drawing.Font, Int32)
      at System.Windows.Forms.ThreadExceptionDialog..ctor(System.Exception)
      at System.Windows.Forms.Application+ThreadContext.OnThreadException(System.Exception)
      at System.Windows.Forms.Control.WndProcException(System.Exception)
      at System.Windows.Forms.Control+ControlNativeWindow.OnThreadException(System.Exception)
      at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
Avatar of ste5an
ste5an
Flag of Germany image

The description tells it:

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

Just add proper exception handling. Furthermore, if your application runs also 30 or 60 hours, then you need to check your resource handling of unmanaged resources. E.g. if you draw your own components using bitmaps, then you need to free them.
Avatar of Spike UK

ASKER

Thanks - Can you explain why KERNELBASE.dll is referred to?
Does it appear to be a graphical error then?
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Can you explain why KERNELBASE.dll is referred to
kernel is responsible for memory management. Here it seems your resources are not freed properly and keep on growing memory usages and finally got crashed. But though it is handled by kernel, in stack trace, you are getting it.