
PYTHON CODE TO SIDPLAY SYSTEM EVENT VIDEWER LOGS CODE
The exception code reveals the detail and/or circumstances under which the crash occurred. The important details which the application event log gives us is Faulting application path, Faulting module name and path, Exception code and most importantly Faulting offset. The purpose of faulting application path, faulting module name and path is very obvious. The below two images show the crash report and the application event log when the program crashes on command line by using 1 as the input parameter. Number 1 and 3 generate Access Violation exception, whereas number 2 and 4 generate StackOverflow exception in the dependent DLL and main EXE respectively. The HowToFindCrashInExeCode.exe takes a number between 1 and 4 as a parameter and then accordingly crashes by generating appropriate exception. To understand the event logger/viewer in a better and useful way, I decided to create a simple program which will crash when some specific command line parameter is passed to it. Similar kind of information is shown to the user when a application or program crash takes place on a particular machine. The event viewer is generally located at C:\Windows\system32\eventvwr.exe and once launched the Application event logs can easily be viewed.

I observed that an application or program crash is logged in the Application Event logs and has sufficient information to get hold of the crash or problem location most of the times. In recent years I have started using Event Viewer to check logs of various warnings, errors registered on a particular machine. Few others go over all places to implement try catch blocks generously in the code hoping to narrow down the problem.

Few smart programmers develop a crash logging system on their own to nail down the code which is causing the crash.

This is a tricky problem, as developers cannot debug the crash at client's machine. The end result is endless communication between support team and the customer or even live meetings. I always hear from my juniors and QA' about a particular crash being easily reproduced at client machine and not being reproduced at their machines.
