Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reducing the size of minidumps of managed programs while keeping some heap information?

With the dump debugging support in .NET 4.0 we are looking into automatically (after asking the user of course :) creating minidumps of C# program crashes to upload them to our issue tracking system (so that the minidumps can assist in resolving the cause of the crash).

Everything is working fine when using the WithFullMemory minidump type. We can see both stack and heap variables. Unfortunately the (zipped) dumps are quite large even for small C# programs.

If we use the "Normal" minidump type we get a very small dump, but not even stack variable information is available in the managed debugger. In fact, anything less than WithFullMemory seems quite useless in the managed debugger. We have made a few attempts at using a MINIDUMP_CALLBACK_ROUTINE to limit the included module information to our own modules, but it seems that it has almost no effect on a managed dump but still manages to break the managed debugging?

Does anyone have any tips on how to trim the minidump while keeping it useful for managed debugging?

like image 535
Ziphnor Avatar asked Jul 27 '10 13:07

Ziphnor


3 Answers

I use the following flags to save space will generating useful minidumps for C++ applications:

MiniDumpWithPrivateReadWriteMemory | 
            MiniDumpWithDataSegs | 
            MiniDumpWithHandleData |
            MiniDumpWithFullMemoryInfo | 
            MiniDumpWithThreadInfo | 
            MiniDumpWithUnloadedModules

The flag values are specified in DbgHelp.h and would need to be marshaled into C#. The dump is further restricted by specifying a CallbackRoutine.

like image 74
M.Stoffregen Avatar answered Dec 22 '22 06:12

M.Stoffregen


Just fyi, as mentioned above ClrDump looks very cool but it appears it only works with the 1.1. and 2.0 runtimes.

like image 30
Brian Hartung Avatar answered Dec 22 '22 07:12

Brian Hartung


With all due respect, I STRONGLY encourage you to sign-up for a Microsoft WinQual account, register your applications with Microsoft.

http://www.microsoft.com/whdc/winlogo/maintain/StartWER.mspx

This will allow you to not only take advantage of Microsoft's extensive crash collection and analysis services (for free!), but will also allow you to publish fixes and patches for your applications through Windows' built-in error reporting facilties.

Further, by participating in the WinQual program, enterprises who deploy your app and who employ an in-house Windows Error Reporting system will be able to collect, report and receive patches for your app too.

Another benefit is that employing WinQual, you're one step closer to getting your app logo certified!

Every OEM & ISV I've worked with who uses WinQual saves an ENORMOUS amount of effort and expense compared to rolling their own crash collection and reporting system.

like image 42
Rich Turner Avatar answered Dec 22 '22 07:12

Rich Turner