The Big Picture: Being a Detective After the Crash
When a PC blue-screens, Windows leaves evidence behind: the stop code, a crash dump (a snapshot of memory at the moment of the crash), and entries in the event log. Debugging is detective work with that evidence. You ask: what was running, what did it touch, and who is the most likely culprit?
This section gives a beginner's map of the tools: WinDbg, minidump analysis, Event Viewer, simple command-line tools, and the Verifier as a stress-testing partner. You do not need to become an expert. Knowing the basic steps is enough to read a crash report and find a driver name.
15.1 WinDbg Overview
What it is: WinDbg is Microsoft's free debugger (a program for looking inside other programs, or inside Windows itself). It is the main tool for kernel and driver debugging. It is available from the Microsoft Store (called WinDbg) or as part of the Windows SDK / WDK.
What WinDbg can do:
| Ability | Meaning |
|---|---|
| Open a crash dump | Study a minidump or MEMORY.DMP file after the crash (post-mortem) |
| Live kernel debugging | Connect to a running PC (usually a test PC or VM) and pause it, step through code |
| Show call stacks | The chain of functions that led to the crash |
| List drivers | Which .sys files were loaded, their versions and dates |
| Use symbols | Turns raw memory addresses into readable names (see below) |
Symbols. Compiled code is just numbers. Symbol files (.pdb) give the names of functions and variables. Microsoft provides symbols for Windows through the Microsoft Symbol Server. WinDbg downloads them as needed. You set the symbol path once to:
srv*C:\Symbols*https://msdl.microsoft.com/download/symbols
Kernel debugging basics. Two PCs (or one PC and a VM) are used:
┌──────────────────────┐ cable / network / virtual link ┌──────────────────────┐
│ HOST PC │◄──────────────────────────────────►│ TARGET PC (test) │
│ runs WinDbg │ │ runs Windows + the │
│ you control it here │ │ driver being tested │
└──────────────────────┘ └──────────────────────┘
The target is paused when it hits a breakpoint or crashes, and the host examines it. This is how driver developers work. (On the target the debug setting is turned on with bcdedit /debug on; only do this on a test machine.)
A few of the most-used WinDbg commands:
| Command | What it does |
|---|---|
!analyze -v | Automatic analysis: shows the stop code, parameters, the probable faulty module and the call stack. Start here |
k | Show the call stack |
lm | List loaded modules (drivers and DLLs) |
lmvm name | Details of one module (version, date, company) |
!irp address | Show an IRP (Section 9) |
!devobj address | Show a device object (Section 4.4) |
!drvobj name | Show a driver object (Section 4.3) |
!devstack address | Show a whole device stack (Section 4.5) |
.bugcheck | Show the bug check code and parameters |
15.2 Minidump Analysis Basics
What it is: A minidump is the small file Windows writes when it crashes (Section 14.2), found in C:\Windows\Minidump. Opening it in WinDbg is the beginner's path to finding a bad driver.
Step by step:
| # | Step |
|---|---|
| 1 | Make sure dumps are being written: System Properties → Advanced → Startup and Recovery → Write debugging information (Small memory dump or Automatic memory dump) |
| 2 | After a crash, find the newest .dmp file in C:\Windows\Minidump (copy it to your desktop; you may need administrator rights) |
| 3 | Open WinDbg → File → Open dump file |
| 4 | Set the symbol path (above) and wait for symbols to load |
| 5 | Type !analyze -v and press Enter |
| 6 | Read the result (below) |
What !analyze -v shows, simplified, with a made-up example:
BUGCHECK_CODE: d1
BUGCHECK_STR: DRIVER_IRQL_NOT_LESS_OR_EQUAL
Arg1: ffffd0010a2b3c40 memory that was referenced
Arg2: 0000000000000002 IRQL at the time of the access
Arg3: 0000000000000000 0 = read, 1 = write
Arg4: fffff80123451234 address of the instruction that did it
MODULE_NAME: mydriver
IMAGE_NAME: mydriver.sys
STACK_TEXT:
nt!KeBugCheckEx
nt!KiBugCheckDispatch
nt!KiPageFault
mydriver!ProcessPacket+0x4a <-- the failing function
mydriver!DpcRoutine+0x31
nt!KiRetireDpcList
...
How to read it:
| Item | Meaning |
|---|---|
| BUGCHECK_CODE / STR | The stop code (here 0xD1 = DRIVER_IRQL_NOT_LESS_OR_EQUAL) |
| Arguments | Details: the memory address, the IRQL (here 2, DISPATCH_LEVEL), read or write, and the instruction address |
| IMAGE_NAME | The driver file that probably caused it |
| STACK_TEXT | The chain of functions: the top is where it crashed; below it is who called it |
Here, the story is: mydriver.sys, while running a DPC (IRQL 2), touched memory that wasn't available. Boom. That matches Section 14.2.
Be careful with conclusions. !analyze often names the module that was running, but memory damage caused by a different driver may be the real cause (Section 14.1). Signs that it isn't a simple driver bug: many different drivers named across different crashes, or the cause listed as memory_corruption / "pool corruption." That is when you suspect bad RAM or turn on the Verifier on a test PC.
Non-expert shortcuts. Several free third-party tools (for example BlueScreenView or WhoCrashed) read the minidumps for you and show the driver name. They are not part of Windows, so download them only from the maker's official site.
Windows' own clues, without any debugger:
| Where | What you find |
|---|---|
Event Viewer (eventvwr) → Windows Logs → System | Event ID 41 (Kernel-Power: "the system rebooted without cleanly shutting down first") and ID 1001 (BugCheck: the stop code and the dump file location) |
Reliability Monitor (perfmon /rel) | A calendar of crashes and failures, easy to read |
| Event Viewer → System, source Service Control Manager | Errors like "The XYZ service failed to start" for drivers loaded as services |
| Event Viewer → Microsoft-Windows-Kernel-PnP / DriverFrameworks logs | Driver install and device-start errors |
Command-line tools (safe, read-only):
| Command | What it shows |
|---|---|
driverquery | A list of loaded drivers with type and link date |
driverquery /v | Adds details: state, start mode, path |
driverquery /si | Whether each driver is signed |
pnputil /enum-devices /problem | Devices that currently have a problem code (Windows 10 1607 and later) |
Get-PnpDevice -PresentOnly | Where-Object Status -ne 'OK' | PowerShell: devices that are not OK |
15.3 Driver Verifier Stress Testing
What it is: This ties together Section 14.3 and the debugger. Verifier makes a hidden bug show itself right away and clearly, so the dump points to the real culprit rather than a victim.
The typical workflow of a developer (or advanced tester) on a test machine or VM:
1. Pick the driver to test (verifier → Create custom settings →
choose only that driver)
2. Turn on standard checks (special pool, IRQL, deadlock, ...)
3. Restart the test PC
4. Use the device hard (copy big files, plug/unplug, sleep/wake,
run the driver's tests)
5. If a bug exists ──► blue screen with the code DRIVER_VERIFIER_DETECTED_VIOLATION
(stop code 0xC4), pointing exactly at the faulty driver
6. Open the dump in WinDbg ──► !analyze -v ──► fix the bug
7. Turn Verifier OFF ( verifier /reset ) and restart
Typical stop codes with Verifier on: DRIVER_VERIFIER_DETECTED_VIOLATION (0xC4), DRIVER_VERIFIER_IOMANAGER_VIOLATION (0xC9), and DRIVER_CORRUPTED_EXPOOL.
Other stress tools Microsoft provides for developers (names only): the Hardware Lab Kit (HLK) tests, Device Fundamentals tests, and Static Driver Verifier (examines the source code without running it).
Reminder (see Section 14.3): Verifier can cause boot loops. Use it only on a test machine or VM. If a PC is stuck, boot to Safe Mode or the recovery command prompt and run
verifier /reset.
A beginner's debugging checklist:
- What was the stop code and the
.sysname? - What changed recently? (New driver, update, hardware)
- Check Event Viewer (System log: IDs 41 and 1001; also Service Control Manager errors).
- Check Device Manager for yellow warning icons and their Code number (Properties → General).
- Run
driverquery /vandpnputil /enum-devices /problem. - Update or roll back the suspect driver; re-test.
- If the evidence is unclear, open the dump in WinDbg with
!analyze -v. - Still random? Suspect hardware: test RAM (Windows Memory Diagnostic), check temperatures, disks.
Summary
| Term | Plain meaning |
|---|---|
| WinDbg | Microsoft's free debugger for crash dumps and live kernel debugging |
| Symbols (.pdb) | Files that turn memory addresses into readable function names |
!analyze -v | WinDbg command that analyses a crash and suggests the culprit |
| Minidump | Small crash file in C:\Windows\Minidump; open it in WinDbg |
| Stack trace | The chain of function calls leading to the crash |
| Event Viewer | Look for Kernel-Power 41 and BugCheck 1001 in the System log |
driverquery | Safe command to list drivers (with /v for details, /si for signing) |
| Verifier workflow | Stress a chosen driver on a test PC, read the dump, fix, then verifier /reset |