Anatomy of WerFault.exe’s Application Crash Error Reporting
Not much information is available on Windows Error Reporting’s WerFault.exe
, the process that is launched by the OS whenever an application crashes. This post documents the launch sequence of WerFault.exe
and its related processes along with their command line parameters.
How WerFault.exe Handles an Application Crash
The following sequence shows how Windows Error Reporting (WER) handles a typical application crash on my machine (Windows 10 20H2). Most of the data is from uberAgent, our application monitoring and security analytics product.
- Unhandled exception in a process with PID 5700 running in session ID 1. This is the crash that triggers WER.
- Service Control Handler starts
Windows Error Reporting Service
(WerSvc
)- Command line:
C:\WINDOWS\System32\svchost.exe -k WerSvcGroup
- Session: 0
- User:
SYSTEM
- Command line:
Windows Error Reporting Service
startsWerFault.exe
with PID 35380- Command line:
C:\WINDOWS\system32\WerFault.exe -pss -s 468 -p 5700 -ip 5700
-pss
: process snapshotting mode-s
: ?-p
: process ID-ip
: initiating process ID
- Session: 0
- User:
SYSTEM
- Command line:
WerFault.exe
PID 35380 in session 0 stops after approx. 60 ms- A second instance of
WerFault.exe
is started, this time PID 33360 in the crashing process’ session- Command line:
C:\WINDOWS\system32\WerFault.exe -u -p 5700 -s 10268
-u
: user mode-p
: process ID-s
: ?- Session: 1
- User: the crashing process’ user
- Parent: the crashing process PID 5700
- Command line:
- Event ID 1000 is generated in the application event log
- Most likely by
WerFault.exe
PID 33360 - Event source:
Application Error
- Event message text (excerpt):
Faulting application name: [crashed EXE], version: [EXE version], time stamp: [EXE build time]
- Most likely by
Task Scheduler
service (Schedule
) startswermgr.exe
with PID 21732- Command line:
C:\WINDOWS\system32\wermgr.exe -upload
- Session: 0
- User:
SYSTEM
- Command line:
WerFault.exe
PID 33360 in session 1 stops after approx. 960 ms- The crashed process PID 5700 stops
wermgr.exe
PID 21732 stops after approx. 1.8 sWindows Error Reporting Service
stops after approx. 2 min
WerFault’s Command-Line Arguments
Information on the command-line arguments of WerFault.exe
are scarce. This is what I could find.
The First Argument
WerFault’s first argument seems to set the mode of operation:
- -pss: process snapshotting mode via
PssNtCaptureSnapshot
[deduced from WerFault’s strings] - -u: user mode (dump creation)
Additional Arguments
- -s: [unknown]
- -p: process ID
- -ip: initiating process ID [deduced from WerFault’s strings]