5

We have an in-proc crash handler which is using MiniDumpWriteDump() from DbgHelp to write a minidump is case of a process crash. I know its not the best way to do it, however, at the moment we do not have other option.

The problem is: one certain executable always creates 0 byte dumps. But it works well for other processes. What could be the possible reason behind this behavior?

CsTamas
  • 4,103
  • 5
  • 31
  • 34

1 Answers1

7

We had this problem from time to time with our minidumping code. In the end we changed it to spawn a lightweight secondary process on startup and used a simple MMF to communicate with the dumper process when we needed a minidump generated.

We had all sorts of problems using MiniDumpWriteDump from within the process being dumped. Since the change to a dedicated dumping process, it's been very reliable.

If at all possible I suggest you consider the same. It ended up not being that much work.

anelson
  • 2,569
  • 1
  • 19
  • 30
  • @anelson, How do you get the exception information (I mean the `PEXCEPTION_POINTERS`) from one process to another? Just merely passing the pointers to MMF would not work, would it? – Tamás Szelei Apr 06 '16 at 08:35
  • @TamásSzelei you don't pass the exception information to the dumper process, you trigger the dumper process from within the exception handler. The dump will include the stack frame including the exception information. – anelson Apr 09 '16 at 17:06
  • @anelson, but if I don't pass the exception information, I will just end up with a stack trace right in the undhandled exception filter with no easy way to get to where the exception occured. Am I missing something? – Tamás Szelei Apr 10 '16 at 09:01