Closed Bug 1681245 Opened 5 years ago Closed 4 years ago

Investigate if it is possible to use `WerRegisterRuntimeExceptionModule` to capture locally minidumps generated by WER

Categories

(Toolkit :: Crash Reporting, task, P1)

Unspecified
Windows
task

Tracking

()

RESOLVED FIXED

People

(Reporter: gsvelto, Assigned: gsvelto)

References

Details

As per title.

Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
Priority: -- → P1

Alright, these were the important bits I was missing:

  • You have to create a separate DLL that contains three callbacks that will be called out-of-process by WER to decide whenever it takes the crash or not. See the remarks here
  • You have to register this DLL using WerRegisterRuntimeExceptionModule. It's worth noting that this function doesn't seem to check if the DLL you provided exists. It justs records it for later use.
  • You have to add a registry entry under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\RuntimeExceptionHelperModules with the full path of the DLL you registered (or under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\Windows Error Reporting\ of you're a 32-bit app running under 64-bit Windows).

There's an example module available here.

I'm putting all this background info here so that it doesn't get lost.

Quick update: I managed to clobber together a Gecko build that wires up all the necessary bits and throws exceptions using __fastfail(). Tomorrow I'll test it to see if we can capture those this way.

I forgot to update the status here. I did manage to capture a __fastfail() crash using what I described above. It's interesting because apparently ~4 years ago this wasn't possible. My guess is that Microsoft changed the way WER plugins work in the meantime. One thing to keep in mind is that I had to do things a little differently than what was shown in the examples I found. Most of the existing code use the OutOfProcessExceptionEventCallback() to claim the crash (so that WER won't take it) and then use OutOfProcessExceptionEventSignatureCallback() to write the minidump. For regular crashes this work, but not for __fastfail() ones. For __fastfail() crashes only OutOfProcessExceptionEventCallback() gets called in the WER plugin, but it has all the data one needs to write out a minidump so that's OK.

I'm also changing the title to reflect the fact that at the beginning of this investigation I was looking at the right API, but at the wrong function :-)

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Summary: Investigate if it is possible to use `WerRegisterAppLocalDump` to capture locally minidumps generated by WER → Investigate if it is possible to use `WerRegisterRuntimeExceptionModule` to capture locally minidumps generated by WER
You need to log in before you can comment on or make changes to this bug.