As I was waiting for a minidump I was grabbing on a very large and busy server application to finish writing, my mind wandered and I realized there were quite a few ways to grab a minidump today. Back in the old Windows days, when we had to program up hill in the snow both ways, there was only WinDBG. Now it seems like an application isn’t complete unless it produced a minidump. I thought I’d throw out all the ways I know off the top of my head. Of course, I’m sure there are other ways so please add them in the comments!
Note: I’m only using Windows 7 and Server 2008 R2 these days so some of these might not work on legacy Windows operating systems.
The original heavy duty way to create a minidump. To create a full memory minidump, which you’ll need in order to work with .NET’s SOS/SOSEX/PSSCOR2 extensions or for native code to follow all memory like linked lists, use the /ma option.
With Visual Studio 2010, the wonderful “Save Dump As…” menu option now appears on the Debug menu for both native and managed debugging. Any time you need a minidump while debugging, just grab one. Add in the fact that Visual Studio 2010 has the awesome minidump reading capabilities, especially for .NET code, we can now spend way less time in WinDBG.
Many people don’t realize that TaskManager knows all about minidumps. When you’re either in the Applications or the Processes tabs, right click on the process and select Create Dump File.
After the minidump is finished, you’ll see the dialog showing you where the dump was created. A nice hidden treat is that the path shown is a read only edit control you can select and copy so you don’t have to try to remember a long path.
You might be wondering what type of minidump TaskManager makes. How about I leave that as an exercise for the reader? OK, that’s cruel. All TaskManager created dumps are full memory minidumps.
TaskManager is fine, but real developers use Process Explorer to fulfill our task management needs. Right clicking on a process lets you choose a minidump or a full memory minidump.
As I am trying to create a complete list I do need to include the Windows API that actually creates the minidumps themselves: MiniDumpWriteDump. There’s nothing stopping you from writing your own program that creates minidumps.
The sweet SysInternals ProcDump tool is designed to get you a minidump when specific nasty issues happen to your processes. It’s great for snagging dumps when you have intermittent CPU spikes or memory usage. I find that I’m using this tool constantly on production servers to get minidumps of those hard to reproduce problems. Everyone using computers needs to know about this tool, even your grandmother!
Got IIS problems? DebugDiag is for you. The ability to script when the dump occurs is pretty interesting. The always brilliant Tess Ferrandez has a great blog post that helps you to decide when you should use ADPlus/WinDBG vs. DebugDiag that’s worth reading.
If your company signs up for Windows Error Reporting you’ll get the same minidumps Microsoft gets. For native developers, WER is a wonderful resource but for .NET developers you only get basic minidumps so it’s not as useful.
Do you know of any other ways to capture a minidump?
Cloud management is difficult to do manually, especially if you work with multiple cloud…
Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…
https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…
FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…
Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…
In the intricate landscape of modern business, compliance is both a cornerstone of operational integrity…
View Comments
John,
In addition to WER generating dumps, We can generate dumps explicitly WER API
http://msdn.microsoft.com/en-us/library/bb513635%28VS.85%29.aspx
http://naveensrinivasan.com/2010/06/09/using-window-error-reporting-wer-api-in-managed-code-to-generate-memory-dump/
PingBack from http://topsy.com/training.atmosera.com/CS/blogs/jrobbins/archive/2010/06/17/how-to-capture-a-minidump-let-me-count-the-ways.aspx?utm_source=pingback&utm_campaign=L2
I think the real question is why would you ever want to spend less time in WinDbg? It's way more powerful than Visual Studio.
WER can be configured to capture dumps and save them locally whenever a process crashes.
http://msdn.microsoft.com/en-us/library/bb787181(v=VS.85).aspx
Brian
What is the recommended way to launch a JIT debugger for .net apps in windows 7?
Thanks,
Brian
I agree with Jeff Curless! Windbg all the way!
Also check out "Collecting User-Mode Dumps" which configures WER to locally store full dumps after a user mode app crashes.
http://msdn.microsoft.com/en-us/library/bb787181%28VS.85%29.aspx
All,
Great comments everyone! Thanks for contributing. Note that one drawback to the WER local dumps (http://msdn.microsoft.com/en-us/library/bb787181(VS.85).aspx) is that it only works for native applications, not .NET apps. It looks like because .NET apps have a custom error handler, they don't let the exception percolate up to the OS level. That's a total bummer as far as I'm concerned.
- John Robbins
Hi John,
Dont leave us hanging...
What is the recommended way to automatically capture .net crashes on Vista/Win7?
Brian
In the old days you could use these to launch any debugger but they dont seem to work on Vista/Win7
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionAeDebugDebugger
HKEY_LOCAL_MACHINESOFTWAREMicrosoft.NETFrameworkDbgManagedDebugger