How to get a user dump and immediate kernel dump in Windows for an application crash
Overview
Application crashes randomly. Dump file attempts have been spotty and point to a potential kernel issue. You want a dump of the process plus a dump of the Windows kernel to examine. You can download the following tools:
To start the debug process, do the following steps:
-
Install DebugDiag 2.3 with administrator privilege. It creates a service so once you are done you do not need to keep logged onto the console for the trap to work.
-
Attach the debugger (follow the steps in the Collection wizard) to the process from which you need a user mode dump.
-
Decompress NotMyFault somewhere easy to get to (that is, D:\temp).
Make a batch file to run NotMyFault. schtasks /delete /TN \Microsoft\Windows\PLA\ /F
D:\temp\notmyfault /crash
-
Save it as D:\temp\stop.bat.
If you configured step 3, the batch file deletes its source tasks from task scheduler and then crashes the Windows host with a kernel dump. If not, an ‘automatic’ dump, is created which may still be ok.
Create a Performance Alert trigger
To create a Performance alert trigger, perform the following steps:
-
Get the PID (process id) of the crashing user mode process (Task Manager>More details shows you this)
-
Start perfmon.exe (Perfmon). Create a new user data collector set.
-
Name it stop above and click the Create manually (Advanced) button. Click Next.
-
Select Performance Counter Alert. Click Next.
-
For the top left pane, expand Process and then select ID Process. Perfmon is quirky so you may need to click something else then click back to ID Process. Then in the bottom left pane, pick the process name (in my example, AISuite3). Click Add.
-
Set the Alert When field to Above and the Limit field to 777. (For this article the PID is 777).
-
Repeat step 6 for below with a below rule on 777. The result should be 2 data collectors.
-
Click the stop above and stop below data collectors which are indicated by a blue cube. Right-click on each one and select Properties, and then click the Task tab. Set the task to the D:\temp\stop.bat file. Click OK.
-
On each Data Collector, right-click and then select Start. This sets the PID of your process changes from the one specific in the two data collector sets, the system crashes.
When this all happens, the computer restarts, you have a memory.dmp file in the C:\Windows folder, and a user-mode dump of your target process in the DebugDiag folder (or elsewhere if you configured that path differently).