Kernel Mode Debugging - Scenario 3: Identify the cause of a driver crash
Microsoft (R) Windows Debugger Version 6.11.0001.404 X86
Copyright (c) Microsoft Corporation. All rights reserved.
Loading Dump File
Kernel Complete Dump File: Full address space is available
Symbol search path is: SRV*C:\symsrv*https://msdl.microsoft.com/download/symbols
Executable search path is:
Windows 2000 Kernel Version 2195 UP Checked x86 compatible
Product: WinNt
Machine Name:
Kernel base = 0x80400000 PsLoadedModuleList = 0x804d5e20
Debug session time: Mon May 1 22:07:46.721 2000 (GMT-8)
System Uptime: 0 days 0:01:59.231
Loading Kernel Symbols
Loading User Symbols
kd> !analyze -v
*******************************************************************************
* Bugcheck Analysis *
*******************************************************************************
IRQL_NOT_GREATER_OR_EQUAL (9)
Arguments:
Arg1: fe4c275c
Arg2: 00000000
Arg3: 00000000
Arg4: 00000000
Debugging Details:
------------------
*... comments clipped
DEFAULT_BUCKET_ID: DRIVER_FAULT
BUGCHECK_STR: 0x9
LAST_CONTROL_TRANSFER: from f90a8799 to 804b0c2f
STACK_TEXT:
fc2a0bcc f90a8799 e19a9f50 000000b8 00000190 nt!KefAcquireSpinLockAtDpcLevel+0x3f
WARNING: Stack unwind information not available. Following frames may be wrong.
fc2a0c14 80424606 fe4c26f0 ffb31d48 ffb35c38 ABCDMA+0x799
fc2a0c2c 80541e77 fe4e3a48 80068f7c 80063418 nt!IopfCallDriver+0x4f
fc2a0c60 8056f9fa ffb361d0 fe4c26f0 0012019f nt!IopCloseFile+0x2b3
fc2a0c90 80493505 ffb361d0 00000001 ffb35c00 nt!ObpDecrementHandleCount+0x1e0
fc2a0d4c 804b19ba 00000070 00ba0018 00000000 nt!NtClose+0x295
fc2a0d4c 77f88583 00000070 00ba0018 00000000 nt!KiSystemService+0x10a
0006ff1c 77e8a70a 00000070 0006ff80 01001a93 ntdll!NtClose+0xb
0006ff28 01001a93 00000070 00000000 77fb80db KERNEL32!CloseHandle+0x4f
0006ff80 01001b93 00000002 006a0200 006a0220 ABCDMA+0x1a93
0006ffc0 77e87903 ffffffff 0012f88f 7ffdf000 ABCDMA+0x1b93
0006fff0 00000000 01001ac0 00000000 000000c8 KERNEL32!BaseProcessStart+0x3d
STACK_COMMAND: kb
FOLLOWUP_IP:
dummydma+799
f90a8799 8b4d08 mov ecx,dword ptr [ebp+8]
SYMBOL_STACK_INDEX: 1
SYMBOL_NAME: ABCDMA+799
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: ABCDMA
IMAGE_NAME: ABCDMA.sys
DEBUG_FLR_IMAGE_TIMESTAMP: 390e698d
FAILURE_BUCKET_ID: 0x9_dummydma+799
BUCKET_ID: 0x9_ABCDMA+799
Followup: MachineOwner
kd> *get details for faulty driver
kd> !drvobj ABCDMA 2
Driver object (fe4c28c8) is for:
\Driver\ABCDMA
Dispatch routines:
[00] IRP_MJ_CREATE f90a8614 ABCDMA+0x614
[01] IRP_MJ_CREATE_NAMED_PIPE 8042e25e nt!IopInvalidDeviceRequest
[02] IRP_MJ_CLOSE f90a8614 ABCDMA+0x614
[03] IRP_MJ_READ 8042e25e nt!IopInvalidDeviceRequest
[04] IRP_MJ_WRITE 8042e25e nt!IopInvalidDeviceRequest
[05] IRP_MJ_QUERY_INFORMATION 8042e25e nt!IopInvalidDeviceRequest
[06] IRP_MJ_SET_INFORMATION 8042e25e nt!IopInvalidDeviceRequest
[07] IRP_MJ_QUERY_EA 8042e25e nt!IopInvalidDeviceRequest
[08] IRP_MJ_SET_EA 8042e25e nt!IopInvalidDeviceRequest
[09] IRP_MJ_FLUSH_BUFFERS 8042e25e nt!IopInvalidDeviceRequest
[0a] IRP_MJ_QUERY_VOLUME_INFORMATION 8042e25e nt!IopInvalidDeviceRequest
[0b] IRP_MJ_SET_VOLUME_INFORMATION 8042e25e nt!IopInvalidDeviceRequest
[0c] IRP_MJ_DIRECTORY_CONTROL 8042e25e nt!IopInvalidDeviceRequest
[0d] IRP_MJ_FILE_SYSTEM_CONTROL 8042e25e nt!IopInvalidDeviceRequest
[0e] IRP_MJ_DEVICE_CONTROL f90a891d ABCDMA+0x91d
[0f] IRP_MJ_INTERNAL_DEVICE_CONTROL 8042e25e nt!IopInvalidDeviceRequest
[10] IRP_MJ_SHUTDOWN 8042e25e nt!IopInvalidDeviceRequest
[11] IRP_MJ_LOCK_CONTROL 8042e25e nt!IopInvalidDeviceRequest
[12] IRP_MJ_CLEANUP f90a8751 ABCDMA+0x751
[13] IRP_MJ_CREATE_MAILSLOT 8042e25e nt!IopInvalidDeviceRequest
[14] IRP_MJ_QUERY_SECURITY 8042e25e nt!IopInvalidDeviceRequest
[15] IRP_MJ_SET_SECURITY 8042e25e nt!IopInvalidDeviceRequest
[16] IRP_MJ_POWER f90aac4b ABCDMA+0x2c4b
[17] IRP_MJ_SYSTEM_CONTROL f90aaeac ABCDMA+0x2eac
[18] IRP_MJ_DEVICE_CHANGE 8042e25e nt!IopInvalidDeviceRequest
[19] IRP_MJ_QUERY_QUOTA 8042e25e nt!IopInvalidDeviceRequest
[1a] IRP_MJ_SET_QUOTA 8042e25e nt!IopInvalidDeviceRequest
[1b] IRP_MJ_PNP f90aa364 ABCDMA+0x2364
kd> * 0x9_ABCDMA+799 ... means we have no symbols ... ret address f90a8799
kd> ?ABCDMA
Evaluate expression: -116752384 = f90a8000
kd> ?f90a8799-ABCDMAEvaluate expression: 1945 = 00000799
kd> * 751 is in closest proximity of 799
kd> !irp 80068f7c
IRP signature does not match, probably not an IRP
kd> * does not work, because IopfCallDriver is (f)ast and uses registers, not call stack
kd> !irp ffb31d48
Irp is active with 2 stacks 2 is current (= 0xffb31ddc)
No Mdl Thread fe3272f0: Irp stack trace.
cmd flg cl Device File Completion-Context
[ 0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
>[ 12, 0] 0 0 fe4c26f0 ffb35c38 00000000-00000000
\Driver\ABCDMA
Args: 00000000 00000000 00000000 00000000
kd> * 12 is entry point in driver, 12 == cleanup
kd> *------------
kd> !thread
THREAD fe3272f0 Cid 27c.2b8 Teb: 7ffde000 Win32Thread: e1bae008 RUNNING
IRP List:
ffb31d48: (0006,00b8) Flags: 00000404 Mdl: 00000000
Not impersonating
Owning Process ffb361d0
Wait Start TickCount 11906 Elapsed Ticks: 0
Context Switch Count 985 LargeStack
UserTime 0:00:00.0020
KernelTime 0:00:01.0111
Start Address KERNEL32!BaseProcessStartThunk (0x77e878c1)
Win32 Start Address ABCDMA (0x01001ac0)
Stack Init fc2a1000 Current fc2a076c Base fc2a1000 Limit fc29d000 Call 0
Priority 9 BasePriority 8 PriorityDecrement 0 DecrementCount 0
ChildEBP RetAddr Args to Child
fc2a0bcc f90a8799 e19a9f50 000000b8 00000190 nt!KefAcquireSpinLockAtDpcLevel+0x3f
fc2a0c14 80424606 fe4c26f0 ffb31d48 ffb35c38 ABCDMA+0x799
fc2a0c2c 80541e77 fe4e3a48 80068f7c 80063418 nt!IopfCallDriver+0x4f
fc2a0c60 8056f9fa ffb361d0 fe4c26f0 0012019f nt!IopCloseFile+0x2b3
fc2a0c90 80493505 ffb361d0 00000001 ffb35c00 nt!ObpDecrementHandleCount+0x1e0
fc2a0d4c 804b19ba 00000070 00ba0018 00000000 nt!NtClose+0x295
fc2a0d4c 77f88583 00000070 00ba0018 00000000 nt!KiSystemService+0x10a
0006ff1c 77e8a70a 00000070 0006ff80 01001a93 ntdll!NtClose+0xb
0006ff28 01001a93 00000070 00000000 77fb80db KERNEL32!CloseHandle+0x4f
0006ff80 01001b93 00000002 006a0200 006a0220 ABCDMA+0x1a93
0006ffc0 77e87903 ffffffff 0012f88f 7ffdf000 ABCDMA+0x1b93
0006fff0 00000000 01001ac0 00000000 000000c8 KERNEL32!BaseProcessStart+0x3d
kd> !irp ffb31d48
Irp is active with 2 stacks 2 is current (= 0xffb31ddc)
No Mdl Thread fe3272f0: Irp stack trace.
cmd flg cl Device File Completion-Context
[ 0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
>[ 12, 0] 0 0 fe4c26f0 ffb35c38 00000000-00000000
\Driver\ABCDMA Args: 00000000 00000000 00000000 00000000
kd> *-------------