5

I have a .NET process that sometimes fails with AccessViolationException in the native code of some 3rd party library.

I wish to have full memory mini dump when that happens. I have read this page - http://support.microsoft.com/kb/931673, the section "To collect user-mode dumps" and configured the registry as the article explains. However, when the crash occurrs, a really small report is created - no *.mdmp file is in sight.

Now, I know how to run the process from within ADPLus or how to make it attach to an already running process. But it requires running ADPLus explicitly.

I was wondering how can I configure windows to run ADPlus automatically, each time I start the problematic process no matter how it is started - from msbuild, double clicked, from console script, etc...

Meaning, when running aaaa.exe is replaced by running ADPlus with certain flags which spawns aaaa.exe with the respective command line options.

I know there are image execution flags in windows, which do that, but I do not know the details.

Thanks.

EDIT1

It is important to preserve the command line parameters, so if aaa.exe is run with a flag, then, of course, the same should be true when running aaa.exe from the debugger.

skaffman
  • 398,947
  • 96
  • 818
  • 769
mark
  • 59,016
  • 79
  • 296
  • 580
  • What's the benefit over Windows Error Reporting (WER) configured to take local dumps? http://msdn.microsoft.com/en-us/library/windows/desktop/bb787181%28v=vs.85%29.aspx – Thomas Weller Dec 30 '13 at 23:10
  • None, but the question was asked 3 years ago, I did not probably know about WER back then. – mark Dec 31 '13 at 01:44
  • @ThomasW. in the link you provided: "Applications that do their own custom crash reporting, including .NET applications, are not supported by this feature" – Peter Ritchie Jul 01 '14 at 16:39
  • @PeterRitchie: WER LocalDumps works for .NET applications. It just doesn't work for .NET application that have an unhandled exception handler. His application doesn't have an unhandled exception handler (otherwise AdPlus would not work either), so LocalDumps would work in this case. – Thomas Weller Jul 01 '14 at 18:43

1 Answers1

2

Never mind, found it.

  1. Create a key named after the process (like aaa.exe) under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
  2. Add a string value Debugger with the value ADPlus -crash -mss YourSymbolCacheFolderPath -MiniOnSecond -quiet -o YourDumpFolderPath -sc
mark
  • 59,016
  • 79
  • 296
  • 580