If broken it is, fix it you should

Using the powers of the debugger to solve the problems of the world - and a bag of chips    by Tess Ferrandez, ASP.NET Escalation Engineer (Microsoft)

Quick Debugging Tip: Disable apppool recyling while getting crash dumps

Quick Debugging Tip: Disable apppool recyling while getting crash dumps

  • Comments 3

I have probably mentioned this before, but I think it is worth mentioning again because of the frequency of this issue.

When debugging a crash, we usually get customers to use a crash rule in debug diag or to use adplus -crash to get memory dumps at the point of the crash.  Both of these attach to the process and gathers dumps when the process is shutting down, which is exactly what we want...

The problem is that very often we will get what I call "false-positive" dumps.  I.e. dumps when the process is shutting down, but not dumps of an actual crash, or at least not the shutdown we are trying to troubleshoot.

A typical characteristic of such a memory dump is that thread 0 is in the middle of a "normal shutdown"

 

0:000> kL
ChildEBP RetAddr 
0006fc4c 79f96d9b kernel32!ExitProcess
0006fe74 79f96dc7 mscorwks!SafeExitProcess+0x11a
0006fe80 79f0c4a4 mscorwks!HandleExitProcessHelper+0x25
0006ff10 7901145b mscorwks!CorExitProcess+0x242
0006ff20 77bcaddb mscoree!CorExitProcess+0x46
0006ff2c 77bcaefb msvcrt!__crtExitProcess+0x29
0006ff5c 77bcaf52 msvcrt!doexit+0x81
0006ff70 01001a38 msvcrt!exit+0x11
0006ffc0 77e523cd w3wp!wmainCRTStartup+0x140
0006fff0 00000000 kernel32!BaseProcessStart+0x23

 

By normal, I mean that the process is shutting down because the process is either being IISReset, or it is shutting recycled due to health monitoring settings. 

If it was an actual crash, you would typically see some 2nd chance exceptions occurring before the crash, generating 2nd chance exception dumps, and the process shutdown dump would only contain one thread (the last thread standing when the process is shut down).  Btw, this "last thread standing" is usually not thread 0 (the main thread), but rather some unsuspecting "bystander" thread that just happened to be the last thread hanging around at the crime scene, some thread that usually has nothing to do with the actual crash.

Another typical trait of a "false-positive" is that the process has been up for roundabout 20 minutes

 

0:000> .time
Debug session time: Thu Sep 11 17:52:34.000 2008 (GMT+2)
System Uptime: 1 days 9:59:44.203
Process Uptime: 0 days 0:22:03.000
  Kernel time: 0 days 0:00:00.000
  User time: 0 days 0:00:00.000

 

Now, observant readers have probably figured out what is going on here... we get memory dumps when the process shuts down because of the idle timeout

By default, the worker process will shutdown after 1740 mins of processing (29 hrs), and/or when the process has been idle for 20 minutes.

healthmonitoring1 healthmonitoring2

So if either the process has been idle for 20 minutes, or the processing time is 29 hrs, the process will recycle and you will get a "crash" dump if you have a debugger attached. 

In summary, if you are trying to get dumps of a real crash, you need to disable these two settings in order to stop getting "false-positive" dumps, and get dumps on the real crash.

Laters,

Tess

  • I'm probably missing something here, but the title of the post says "Disable Health monitoring while getting a dump", but I don't see anything related to health monitoring...

    Unless you are refering to something else than asp.net health monitoring, the stuff we can use as pseudo-loggers to catch application events (as configured in the web.config) that also happens to be called health monitoring?

  • Agreed:)  Should say, disable recycling options... I changed the title...

    I just refer to anything in the recycling configuration properties as health monitoring settings, but I agree, this is a miss-nomer

  • How did I get here? I'll probably never find my way back unless sxipper brings me back. In the event I do get back. How does SilverLight work? What is the approved/ accepted/denied all about?

    Thank You

    Old-Dog at rc_cola49live.com

Page 1 of 1 (3 items)
Leave a Comment
  • Please add 1 and 6 and type the answer here:
  • Post