3

At the moment my info is (and let's keep the context to Windows-7, as WER doesn't work like that on Win-XP) that I have two ways of getting a full memory crash dump for my application:

I can set up WER to generate a local full memory dump of my application

The info is here: http://msdn.microsoft.com/en-us/library/bb787181%28v=vs.85%29.aspx

  • Add (also for 32bit apps. Do not use SysWow64 node) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps key (possibly app specific subkey ...LocalDumps\MyApplication.exe)
  • Set DumpType to 2.
  • Tweak other settings as neccessary

Note: As our application is custom deployed, setting this registry value isn't a problem.

This seems to give me pretty reliable crash dumps with a simple demo app.

Or, I can rig up the dump writing myself - properly with watchdog process and all

I use MiniDumpWriteDump to write the dump and I do this from a watchdog process (as described here, here) to minimize risk of failure.

Question

So, which is the better approach? Given that, when doing it myself, I prudently keep the stuff I do in the crash handler to an absolute minimum, I'm wondering whether the WER approach is as reliable, or whether the WER approach does some more things in-process that may fail. Any ideas/experiences?

Community
  • 1
  • 1
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
  • It is better to handle this yourself if the contents of the memory dump created by WER does not contain all the information you require, we create mini-dumps (misleadingly named as they can contain more information) and enable all the relevant flags for our product, for me this is better method but the not all platforms support all the available flags so this is the only thing you need to be aware of – EdChum Nov 28 '12 at 10:05
  • Note that there is [_much more_](http://research.microsoft.com/apps/pubs/default.aspx?id=81176) to WER then just writing the dump. For example, it also automatically analyzes the possible crash and provides information like which fault occured how often, etc. Such information is also available to/for third party (products). – Christian.K Nov 28 '12 at 10:42
  • WER can write minidumps in *any* situations! Even a stack corruption or corruption of kernel32.dll. In-process MiniDumpWriteDump will work in _most_ situations... but not in all... – Jochen Kalmbach Aug 01 '13 at 07:46
  • Possible duplicate: http://stackoverflow.com/questions/13591334/what-actions-do-i-need-to-take-to-get-a-crash-dump-in-all-error-scenarios/17988085#17988085 – Jochen Kalmbach Aug 01 '13 at 07:52
  • @Jochen - Totally no duplicate at all. (And note that this here question is specifically **not** about *in-process* but *out-of-process* MiniDumpWriteDump. – Martin Ba Aug 01 '13 at 08:10

1 Answers1

0

As alternative to doing it yourself, you might look into Google Breakpad, wich is a library and toolset for generating and handling crashdumps.

Bart van Ingen Schenau
  • 15,488
  • 4
  • 32
  • 41