How does Windows detect if a program is "stopped working"? - windows

When I clicked the X button to close a program (say it is MYAPP), a dialog popped up saying:
MYAPP has stopped working
Windows can check online for a solution to the problem."
But actually the application had already exited.
Error info:
Problem signature:
Problem Event Name: APPCRASH
Application Name: MYAPP.EXE
Application Version: 1.0.0.0
Application Timestamp: 56a8dfa8
Fault Module Name: MSVCP90D.dll
Fault Module Version: 9.0.30729.6161
Fault Module Timestamp: 4dace5bf
Exception Code: c0000005
Exception Offset: 00007b3f
OS Version: 6.3.9600.2.0.0.272.7
Locale ID: 3081
How does Windows detect if a program is "stopped working"? Does it indicate the application throws an exception or a dead lock?

Windows Error Reporting (WER) will catch unhandled exceptions. It won't catch a deadlock. That dialog box that pops up when a program "stops working" is a WER crash-dump being taken (or it communicating with a MS server to see if it wants to take a crash-dump, etc.).
There are several ways to debug a crashing program that are tried and true (although arduous). Some of these include:
Using GFlags to launch Visual Studio or WinDbg
Including code in the program to launch a debugger
In this case with WER, you could turn on local crash dumps, and then, as long as you have the symbol database (pdb) file, you can debug from a local crash dump. You can read more on taking local crash dumps at Collecting User-Mode Dumps.

Related

Dump Diagnostics

Recently i received the error log below in my windows Server 2012.
Some consequences like web site down happens and a 503 error are launching in the browser.
I caught up on updates in OS and i have searching for this problems, that let me to do some options like:
Remove net.tcp, net.pipe, net.msmq, and msmq.formatname bindings
Install KB2640103 hotfix, that needs to ask for Microsoft Support Customer.
I'm not an expert in Windows Server but would like to understand the situation and receive more comments.
APPLICATION LOG
Log Name: Application Source: Application Error EventId: 1000
Faulting application name: w3wp.exe, version: 8.0.9200.16384, time
stamp: 0x50108835
Faulting module name: clr.dll, version: 4.0.30319.18449, time stamp:
0x528fdca2 Exception code: 0xc00000fd
Fault offset: 0x000000000010c0c5
Faulting process id: 0x474
Faulting application start time: 0x01d05204681c00ea
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Report Id: 49a3bf22-bdf8-11e4-944f-22000afcadb1
Faulting package full name:
Faulting package-relative application ID:
SYSTEM LOG
WAS
Application pool 'v3.xxxxx.com.br' is being automatically
disabled due to a series of failures in the process(es) serving that
application pool.
A process serving application pool 'v3.xxxxx.com.br' suffered a
fatal communication error with the Windows Process Activation Service.
The process id was '4492'. The data field contains the error number.
I solved my problem in 5 steps:
1) I installed a software to get a crash dump. In this case i downloaded the
DebugDiag Tools.
2) I configured the DebugDiag Tool following these instructions in this post
. I didn't need to install WindDbg and Symbols.
After the installation it was configured in this way:
Selecting a Crash rule
Selecting a IIS App pool (w3wp.exe)
Selecting the app pool of my application
Configuring a Stack over flow exception (0xc00000fd) in Advanced Settings/Exceptions and finishing the setup.
3) I waited for a first crash dump to be created in a folder location. Ex: C:\DebugDiag\Logs When the crash dump was created, i used the DebugDiag Analysis to open the file from C:\DebugDiag\Logs and a HTML report has been created.
4) In report was easy to see the problem. In my case, there was a recursive function without stop conditional. It was crashing the w3wp process.
5) Our team fixed the bug and solved the problem
What you have tried is less relevant.
0xc00000fd means stack overflow. Thus, you need to review your code to see if it was caused by yours. If you were able to get a crash dump, that can provide more information about why it crashes.

ClientPerfCountersInstaller.exe stopped working, now can't run Azure solution

I use Visual Studio 2013 with Windows Azure SDK 2.3.
Out of nowhere, after clicking Start without Debugging, my solution took awhile to start, then an error popped up that said that ClientPerfCountersInstaller.exe stopped working. I clicked the Send Information button to send the error to MS, then it exited. "That's weird," I thought. I closed VS, reopened, and tried again. Same thing. Restarted computer, reopened VS, but now, it just hangs while starting the solution (with or without debugging). Azure Compute and Storage Emulators both get started (I can see in the system tray), but nothing else happens. I eventually get the "this is taking longer than expected" message from VS.
I tried uninstalling Windows Azure SDK 2.3, then reinstalling it. That didn't work.
I looked in Windows Event Viewer and noticed the following four errors every time I try to start my solution:
Application: ClientPerfCountersInstaller.exe Framework Version:
v4.0.30319 Description: The process was terminated due to an unhandled
exception. Exception Info: System.ComponentModel.Win32Exception Stack:
at
System.Diagnostics.PerformanceCounterLib.RegisterFiles(System.String,
Boolean) at
System.Diagnostics.PerformanceCounterCategory.Delete(System.String)
at
ClientPerfCountersInstaller.CounterInstaller.ReadConfigAndInstallCounters()
at ClientPerfCountersInstaller.CounterInstaller.Main(System.String[])
|
Faulting application name: ClientPerfCountersInstaller.exe, version:
1.0.5287.0, time stamp: 0x533b317f Faulting module name: KERNELBASE.dll, version: 6.1.7601.18409, time stamp: 0x5315a05a
Exception code: 0xe0434352 Fault offset: 0x000000000000940d Faulting
process id: 0x1918 Faulting application start time: 0x01cf9c5d685efbcd
Faulting application path:
C:\Path-To-Solution\Dealers.Web.WindowsAzure.Local\csx\Debug\roles\Dealers.Web\approot\bin\Microsoft.WindowsAzure.Caching\ClientPerfCountersInstaller.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll Report Id:
a64bfba7-0850-11e4-bd03-b8ca3ac71182
|
The performance strings in the Performance registry value is corrupted
when process Performance extension counter provider. The BaseIndex
value from the Performance registry is the first DWORD in the Data
section, LastCounter value is the second DWORD in the Data section,
and LastHelp value is the third DWORD in the Data section.
|
Unloading the performance counter strings for service windows azure
caching:client (windows azure caching:client) failed. The first DWORD
in the Data section contains the error code.
How did this happen? Does it sound like a file or entry or something just got randomly corrupted?
After Googling, I started to find some articles about rebuilding performance counters. It seems that others have experienced these counters getting corrupted.
This article from MS gives all kinds of detailed information about rebuilding performance counters. I didn't want to do the entire manual process, so I just tried rebuilding all counters with the lodctr /R command first.
I went to Run and typed cmd to open a Command Prompt, then tried the lodctr /R command. It said it rebuilt successfully, but in the Event Viewer, two errors appeared, and one was specifically that it couldn't rebuild Windows Azure's counters.
But then I realized I hadn't opened the Command Prompt as an Administrator, as the article instructed. After doing that, I tried the command again, and no errors appeared in the Event Viewer.
And finally, my solutions would run again, both with and without debugging. Whew! Hope this helps someone else.
when I had error 2, just type lodctr.exe /R from the Windows command prompt C:\windows\system32>
(win 10)

APPCRASH - myapp.exe started crashing from VB6

I've an exe (app1) which is written in VB6, this is called from another VB6 application (app2). This was working all these years and recently started crashing. When I'm riunning app2 and where app1 called is crashing with the following error.
Problem signature:
Problem Event Name: APPCRASH
Application Name: myapp1.exe
Application Version: 6.0.0.0
Application Timestamp: 470bfe05
Fault Module Name: ole32.dll
Fault Module Version: 6.1.7601.17514
Fault Module Timestamp: 4ce7b96f
Exception Code: c0000005
Exception Offset: 00066b21
OS Version: 6.1.7601.2.1.0.256.28
Locale ID: 1033
Additional Information 1: a7aa
Additional Information 2: a7aa91f17ea749d42a4de3b390fa5b3d
Additional Information 3: a7aa
Additional Information 4: a7aa91f17ea749d42a4de3b390fa5b3d
This is crashing only in some machines, it's working in machines with same configuration.
I've tried disabling DEP for this exe, that doesn't help too.
These shouldn't occur in a VB6 program unless it uses API calls in a cavalier manner. Such a program can run just fine until something in the data it works with causes it to fall over on one of these access violation errors.
See What is a C0000005 crash?

vshost-clr2.exe has stopped working

I'm working on an app in VS 2010 on wind2008. It's a .Net 3.5 app that use .Net 2.0 library.
I change all Frameworks to 3.5 .Net and uncheck "Enable the visual studio hosting process"
But When I debug my solution I got this error :
Problem signature:
Problem Event Name: APPCRASH
Application Name: AnalyseFarm.exe
Application Version: 1.0.0.0
Application Timestamp: 5326f157
Fault Module Name: KERNELBASE.dll
Fault Module Version: 6.1.7600.16385
Fault Module Timestamp: 4a5bdfe0
Exception Code: c000041d
Exception Offset: 000000000000aa7d
OS Version: 6.1.7600.2.0.0.274.10
Locale ID: 1036
Additional Information 1: 5ecb
Additional Information 2: 5ecbd308407466ba89616cb69c9e62d8
Additional Information 3: 9ac0
Additional Information 4: 9ac06af1219db569f0ee193c24745b31
any idea , beast regards
Exception Code: c000041d
This tells the tale, that's STATUS_FATAL_USER_CALLBACK_EXCEPTION, "An unhandled exception was encountered during a user callback". Your program threw an exception and it wasn't handled. Which normally automatically breaks into the debugger and displays the Exception Assistant.
However, the exception occurred at a very awkward time, just when the operating system was in a state where it cannot afford to go through the normal rigamarole that it goes through when a thread dies with an exception. This kind of mishap usually occurs when the callback was triggered by 32-bit code but the exception occurred in 64-bit code, there's no good mechanism to marshal 64-bit exceptions back into 32-bit code, the exception information cannot be properly interpreted by such code since it includes 64-bit pointer values. Or the other way around. Windows messages generated by the window manager tend to fall in this category. Beware that this is just a rough guess at the reason, you need to find the real one.
You do so by forcing the debugger to stop at the code where the exception is thrown, before the operating system is asked to deal with it. Use the Debug + Exceptions dialog, tick the Thrown checkboxes to force the debugger to stop at the throw location.

VB6 Crystal Reports 8.5.0.217 - Access Violation Application Crash

Background:
Our company uses Crystal Reports in our legacy product written in VB6 which I'm performing some maintenance duties for.
Its using version 8.5.0.217 [RTM] with no service packs.
The Problem:
Has worked perfectly on Windows XP x86 to date.
In Windows 7 [x86 and x64] we get an Access Violation followed by an application crash and no further usable error information.
The Details:
The application crashes with a large datasets for any report using the active x viewer.
Visual Studio will crash whilst debugging.
The offending code is here:
Crv_Obj(0).ReportSource = ReportParametersFrm.Report
Crv_Obj(0).EnablePopupMenu = True
Crv_Obj(0).ViewReport
I have checked that:
Crv_Obj(0) is a valid object reference.
ReportParametersFrm.Report is a valid reference.
The only information I have is from the event viewer:
Faulting application name: Pyramid.exe, version: 2.2.0.8, time stamp: 0x51e53053
Faulting module name: craxdrt.dll, version: 8.5.0.217, time stamp: 0x3a849e1a
Exception code: 0xc0000005
Fault offset: 0x002ac3d1
Faulting process id: 0x15a8
Faulting application start time: 0x01ce8228a295c8c8
Faulting application path: C:\Program Files\Pyramid\Pyramid.exe
Faulting module path: C:\Program Files\Pyramid\CrystalSys\craxdrt.dll
I have also tried:
Disabling the DEP to no effect.
Changing Compatibility to Windows XP and below.
Running as both privileged and nonprivileged users.
Tried adding in new error handlers to catch the error
[Fruitlessly] searching on Google and this site.
Contacting SAP [to then be ignored].
What I need help with:
Have you seen this before?
Are there any workarounds or something I should be looking for that is obviously wrong?
Is there more recent version of Crystal that supports VB6 or at least
an upgrade path that you know of that I can attempt?
Any and all help would be most appreciated.
After quite a lot of research and digging around it seems that a slightly newer version of craxdrt.dll crviewer.dll fixes the problem.
Simply a case of replacing these libraries in the application lib folder and in C:\Windows\System32\
I've put a copy of the libs here in the event anyone else has this problem as there was very little consistent help/information out there on the internet.

Resources