Getting IIS Worker Process Crash dumps - c#

I'm doing something bad in my ASP.NET app. It could be the any number of CTP libraries I'm using or I'm just not disposing something properly. But when I redeploy my ASP.NET to my Vista IIS7 install or my server's IIS6 install I crash an IIS worker process.
I've narrowed the problem down to my HTTP crawler, which is a multithreaded beast that crawls sites for useful information when asked to. After I start a crawler and redeploy the app over the top, rather than gracefully unloading the appDomain and reloading, an IIS worker process will crash (popping up a crash message) and continue reloading the app domain.
When this crash happens, where can I find the crash dump for analysis?

Download Debugging tools for Windows:
http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx
Debugging Tools for Windows has has a script (ADPLUS) that allows you to create dumps when a process CRASHES:
http://support.microsoft.com/kb/286350
The command should be something like (if you are using IIS6):
cscript adplus.vbs -crash -pn w3wp.exe
This command will attach the debugger to the worker process. When the crash occurs it will generate a dump (a *.DMP file).
You can open it in WinDBG (also included in the Debugging Tools for Windows). File > Open Crash dump...
By default, WinDBG will show you (next to the command line) the thread were the process crashed.
The first thing you need to do in WinDBG is to load the .NET Framework extensions:
.loadby sos mscorwks
then, you will display the managed callstack:
!clrstack
if the thread was not running managed code, then you'll need to check the native stack:
kpn 200
This should give you some ideas. To continue troubleshooting I recommend you read the following article:
http://msdn.microsoft.com/en-us/library/ee817663.aspx

A quick search found IISState - it relies on the Windows debugging tools and needs to be running when a crash occurs, but given the circumstances you've described, this shouldn't be a problem,

Related

Getting memory dump of .Net app from frozen computer

From time to time my 32bit .Net program hangs the entire windows 10 OS. I am unable to get to task manager or a console on the computer to do a dump of my .Net for analysis in windbg. We have tried RDP, RDP to console, remote command line - but no luck accessing the computer - we just have to reboot.
Is there a way to get a Windows 10 diagnostic dump when the OS hangs, and then analyze this as a .Net app in WinDBG? Note: my app is 32bit and dumps created for 64bit apps dont work for my app in WinDbg.
thanks
Unfortunately, if you your windows machine is frozen and is not responding to any input device (keyboard/mouse), the only way to get a dump from that machine is to set up windows kernel debugging.
You will have to follow the steps described here. Once your machine is setup for kernel debugging, and you have verified that you can break into the kernel of the machine where your program is running, wait until the machine is unresponsive and then break into the machine.
This will allow you to examine what windows is currently doing. There is a little bit of learning curve to set up the debugger and use windbg kernel debugging but this is the most powerful debugging environment that windows offer. You can download windbg here. It comes with comprehensive documentation.

asp.net application running in production is crashing

I have an asp.net application written using a combination of technologies such as Asp.net MVC,WebAPI,SignalR etc and it is crashing almost everyday randmoly. I get this message logged by IIS in the event logs
Faulting application w3wp.exe, version 6.0.3790.3959, stamp 45d691cc,
faulting module kernel32.dll, version 5.2.3790.4062
There are no erros in my application log(log4net)
There are no other logs in the application and system logs
I cannot install any tools or profiler in the production server as it requires many levels of approvals and privileges.
I understand that we can use some kind of CLR profiler to get the crash analyzed but even that requires approval and we had a situation where the profiler was causing real slowness to our application as the application is very chatty(Hence signalR) .So I am looking for a solution with minimal impact on runtime but would like to figure out the root cause of the crash.
WER helped me troubleshoot this issue.Enabled crash dump using WER
Windows Registry Editor Version 5.00
�
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\w3wp.exe]
"DumpFolder"=hex(2):63,00,3a,00,5c,00,64,00,75,00,6d,00,70,00,73,00,00,00
"DumpCount"=dword:00000002
"DumpType"=dword:00000002
And this created an hdmp file and I was to get this analyzed using debugdiag and windbg to find out the issue. There was a stackoverflow exception happening and caused the application to crash.
Are you using dedicated application pool for your app ?
if not, you can try to add new application pool and configure it for your application.

JIT Debugging .NET

I have created a service using C# with Visual Studio 2010. Using .NET Framework v4.0. Running on Windows 7, 32 bit machine. The service calls into a native DLL I created. This DLL is throwing an access violation.
I can't debug it and need help.
I start the service and run my IDE as Administrator. The service is running under the same user account as I am logged into the machine as. I attach to the service using Managed v4.0 and Native attach code types. But when it crashes, a dialog pops up that says "An unhandled Microsoft .NET framework exception occurred" in my app. "The Just-In-Time debugger was launched without necessary security permissions. To debug this process, the Just-In-Time debugger must be run as an Administrator. Would you like to debug this process?". Even though I launched Visual Studio with "Run As Administrator".
When I click "Yes" I get another warning "The current debugger is configured to debug code that uses Microsoft .NET Framework v1.0, 1.1, or 2.0. An unhandled exception is being thrown from .NET Framework v4.0 code". Even though I attach to the process using Managed v4.0 and Native. (I've tried just with Managed v4.0 and get same results).
I click okay, and launch a new instance of the IDE. The IDE then displays a warning that says it is "Unable to attach to the crashing process. A debugger is already attached."
So I try again, this time without attaching debugger hoping to get the same JIT pop-up so I can then attach after the crash, but I don't. The process just goes away or I get the usual dialog about creating a mini dump and sending it to Microsoft.
So I tried settling for full crash dump.
I followed the instructions at Collecting User-Mode Dumps to create full dumps. I'll watch as WerFault.exe starts in task manager and watch the file get created and when WerFault it's done, either the crash dump disappears or stack trace is missing native code.
I seem to have similar problems debugging .NET processes from time to time. How can I reliably configure my computer so I can get JIT debugging?

First-chance exception at 0x782260ec in xxx.exe: 0xC0000005: Access violation

My application crashes after some time but I can't find any pattern. I was able to get my hands on crash dump. Application runs on Windows Mobile 6.5. It is written in C#. It uses Imaging API, PInvoks and lots of threads.
When I debugged that dump with Visual Studio 2008, in output it displayed "First-chance exception at 0x782260ec in xxx.exe: 0xC0000005: Access violation"
Call Stack shows 2 entries. But I can't match any of them to call from my code.
windbg.exe indicates that this error occurs in "netcfagl3_5.dll"
Are there some special techniques to analyze dump files from Windows Mobile??
0xC0000005: Access violation means that one of your p/invokes are incorrect. The call tried to write to a memory area which it doesn't have access to (which is typical if the definition is incorrect).
Your dump should contain a stack trace too?
'First-chance exception' usually means an exception that has been handled by user code. If you're using the Vosual Studio & the Windows Mobile emulator for debug then you can turn off exception handling. Go to Debug > Exceptions and check the 'Thrown' column for Win32 Exceptions. Then run the program and try and get it to fall over again.
When the debug runs it will halt execution and break to the debugger when it hits that 'first-chance exception' allowing you to see what is causing that, and see if it's in any way related.
The 'netcfagl3_5.dll' library is part of .NET CF, not your code, which is why you can't match up the debug symbols.
You will need to download windbg, Visual Studio 2008 won't do Post Mortem .NET debugging.
If your development machine is 64-bit, see "How to use Windbg to debug a dump of a 32bit .NET app running on a x64 machine"
Otherwise, see Post Mortem Debug under Windows Mobile with WinDbg. also do some searching on "Windows Mobile Post Mortem Debug".
The best (by far) and easiest way, though is to reproduce this issue while running on the debugger. Post mortem .net debugging is NOT easy.
-PaulH

Fatal Execution Engine Error

All,
I have a console application which is written in .NET 3.5 which retrieves data from a database, does some calculations and post messages in a message queue.
I run the .exe on my PC which runs without any problems. Deploying the .exe in a 64 bit server the application suddenly stops without any errors and when I use the DebugView utility I can see the below error.
[6276] Fatal Execution Engine Error (7A09C12F) (80131506)
I tried compiling with x64, x86 and Any CPU but still the same problem. I tried deploying to another server and still same situation. Anyone has an idea how I should proceed to determine the root cause?
Many Thanks,
MK
Capture a crash dump and analyze it for the root cause.
Link
If you like, open a support case via http://support.microsoft.com

Categories

Resources