Kernel Mode Debugging - Scenario 3: Identify the cause of a driver crash

  1. Microsoft (R) Windows Debugger Version 6.11.0001.404 X86

  2. Copyright (c) Microsoft Corporation. All rights reserved.

  3. Loading Dump File

  4. Kernel Complete Dump File: Full address space is available

  5. Symbol search path is: SRV*C:\symsrv*https://msdl.microsoft.com/download/symbols

  6. Executable search path is:

  7. Windows 2000 Kernel Version 2195 UP Checked x86 compatible

  8. Product: WinNt

  9. Machine Name:

  10. Kernel base = 0x80400000 PsLoadedModuleList = 0x804d5e20

  11. Debug session time: Mon May 1 22:07:46.721 2000 (GMT-8)

  12. System Uptime: 0 days 0:01:59.231

  13. Loading Kernel Symbols

  14. Loading User Symbols

  15. kd> !analyze -v

  16. *******************************************************************************

  17. * Bugcheck Analysis *

  18. *******************************************************************************

  19. IRQL_NOT_GREATER_OR_EQUAL (9)

  20. Arguments:

  21. Arg1: fe4c275c

  22. Arg2: 00000000

  23. Arg3: 00000000

  24. Arg4: 00000000

  25. Debugging Details:

  26. ------------------

  27. *... comments clipped

  28. DEFAULT_BUCKET_ID: DRIVER_FAULT

  29. BUGCHECK_STR: 0x9

  30. LAST_CONTROL_TRANSFER: from f90a8799 to 804b0c2f

  31. STACK_TEXT:

  32. fc2a0bcc f90a8799 e19a9f50 000000b8 00000190 nt!KefAcquireSpinLockAtDpcLevel+0x3f

  33. WARNING: Stack unwind information not available. Following frames may be wrong.

  34. fc2a0c14 80424606 fe4c26f0 ffb31d48 ffb35c38 ABCDMA+0x799

  35. fc2a0c2c 80541e77 fe4e3a48 80068f7c 80063418 nt!IopfCallDriver+0x4f

  36. fc2a0c60 8056f9fa ffb361d0 fe4c26f0 0012019f nt!IopCloseFile+0x2b3

  37. fc2a0c90 80493505 ffb361d0 00000001 ffb35c00 nt!ObpDecrementHandleCount+0x1e0

  38. fc2a0d4c 804b19ba 00000070 00ba0018 00000000 nt!NtClose+0x295

  39. fc2a0d4c 77f88583 00000070 00ba0018 00000000 nt!KiSystemService+0x10a

  40. 0006ff1c 77e8a70a 00000070 0006ff80 01001a93 ntdll!NtClose+0xb

  41. 0006ff28 01001a93 00000070 00000000 77fb80db KERNEL32!CloseHandle+0x4f

  42. 0006ff80 01001b93 00000002 006a0200 006a0220 ABCDMA+0x1a93

  43. 0006ffc0 77e87903 ffffffff 0012f88f 7ffdf000 ABCDMA+0x1b93

  44. 0006fff0 00000000 01001ac0 00000000 000000c8 KERNEL32!BaseProcessStart+0x3d

  45. STACK_COMMAND: kb

  46. FOLLOWUP_IP:

  47. dummydma+799

  48. f90a8799 8b4d08 mov ecx,dword ptr [ebp+8]

  49. SYMBOL_STACK_INDEX: 1

  50. SYMBOL_NAME: ABCDMA+799

  51. FOLLOWUP_NAME: MachineOwner

  52. MODULE_NAME: ABCDMA

  53. IMAGE_NAME: ABCDMA.sys

  54. DEBUG_FLR_IMAGE_TIMESTAMP: 390e698d

  55. FAILURE_BUCKET_ID: 0x9_dummydma+799

  56. BUCKET_ID: 0x9_ABCDMA+799

  57. Followup: MachineOwner

  58. kd> *get details for faulty driver

  59. kd> !drvobj ABCDMA 2

  60. Driver object (fe4c28c8) is for:

  61.  \Driver\ABCDMA

  62. Dispatch routines:

  63. [00] IRP_MJ_CREATE f90a8614 ABCDMA+0x614

  64. [01] IRP_MJ_CREATE_NAMED_PIPE 8042e25e nt!IopInvalidDeviceRequest

  65. [02] IRP_MJ_CLOSE f90a8614 ABCDMA+0x614

  66. [03] IRP_MJ_READ 8042e25e nt!IopInvalidDeviceRequest

  67. [04] IRP_MJ_WRITE 8042e25e nt!IopInvalidDeviceRequest

  68. [05] IRP_MJ_QUERY_INFORMATION 8042e25e nt!IopInvalidDeviceRequest

  69. [06] IRP_MJ_SET_INFORMATION 8042e25e nt!IopInvalidDeviceRequest

  70. [07] IRP_MJ_QUERY_EA 8042e25e nt!IopInvalidDeviceRequest

  71. [08] IRP_MJ_SET_EA 8042e25e nt!IopInvalidDeviceRequest

  72. [09] IRP_MJ_FLUSH_BUFFERS 8042e25e nt!IopInvalidDeviceRequest

  73. [0a] IRP_MJ_QUERY_VOLUME_INFORMATION 8042e25e nt!IopInvalidDeviceRequest

  74. [0b] IRP_MJ_SET_VOLUME_INFORMATION 8042e25e nt!IopInvalidDeviceRequest

  75. [0c] IRP_MJ_DIRECTORY_CONTROL 8042e25e nt!IopInvalidDeviceRequest

  76. [0d] IRP_MJ_FILE_SYSTEM_CONTROL 8042e25e nt!IopInvalidDeviceRequest

  77. [0e] IRP_MJ_DEVICE_CONTROL f90a891d ABCDMA+0x91d

  78. [0f] IRP_MJ_INTERNAL_DEVICE_CONTROL 8042e25e nt!IopInvalidDeviceRequest

  79. [10] IRP_MJ_SHUTDOWN 8042e25e nt!IopInvalidDeviceRequest

  80. [11] IRP_MJ_LOCK_CONTROL 8042e25e nt!IopInvalidDeviceRequest

  81. [12] IRP_MJ_CLEANUP f90a8751 ABCDMA+0x751

  82. [13] IRP_MJ_CREATE_MAILSLOT 8042e25e nt!IopInvalidDeviceRequest

  83. [14] IRP_MJ_QUERY_SECURITY 8042e25e nt!IopInvalidDeviceRequest

  84. [15] IRP_MJ_SET_SECURITY 8042e25e nt!IopInvalidDeviceRequest

  85. [16] IRP_MJ_POWER f90aac4b ABCDMA+0x2c4b

  86. [17] IRP_MJ_SYSTEM_CONTROL f90aaeac ABCDMA+0x2eac

  87. [18] IRP_MJ_DEVICE_CHANGE 8042e25e nt!IopInvalidDeviceRequest

  88. [19] IRP_MJ_QUERY_QUOTA 8042e25e nt!IopInvalidDeviceRequest

  89. [1a] IRP_MJ_SET_QUOTA 8042e25e nt!IopInvalidDeviceRequest

  90. [1b] IRP_MJ_PNP f90aa364 ABCDMA+0x2364

  91. kd> * 0x9_ABCDMA+799 ... means we have no symbols ... ret address f90a8799

  92. kd> ?ABCDMA

  93. Evaluate expression: -116752384 = f90a8000

  94. kd> ?f90a8799-ABCDMAEvaluate expression: 1945 = 00000799

  95. kd> * 751 is in closest proximity of 799

  96. kd> !irp 80068f7c

  97. IRP signature does not match, probably not an IRP

  98. kd> * does not work, because IopfCallDriver is (f)ast and uses registers, not call stack

  99. kd> !irp ffb31d48

  100. Irp is active with 2 stacks 2 is current (= 0xffb31ddc)

  101.  No Mdl Thread fe3272f0: Irp stack trace.

  102.      cmd flg cl Device File Completion-Context

  103.  [ 0, 0] 0 0 00000000 00000000 00000000-00000000

  104. Args: 00000000 00000000 00000000 00000000

  105. >[ 12, 0] 0 0 fe4c26f0 ffb35c38 00000000-00000000

  106.         \Driver\ABCDMA

  107.    Args: 00000000 00000000 00000000 00000000

  108. kd> * 12 is entry point in driver, 12 == cleanup

  109. kd> *------------

  110. kd> !thread

  111. THREAD fe3272f0 Cid 27c.2b8 Teb: 7ffde000 Win32Thread: e1bae008 RUNNING

  112. IRP List:

  113.     ffb31d48: (0006,00b8) Flags: 00000404 Mdl: 00000000

  114. Not impersonating

  115. Owning Process ffb361d0

  116. Wait Start TickCount 11906 Elapsed Ticks: 0

  117. Context Switch Count 985 LargeStack

  118. UserTime 0:00:00.0020

  119. KernelTime 0:00:01.0111

  120. Start Address KERNEL32!BaseProcessStartThunk (0x77e878c1)

  121. Win32 Start Address ABCDMA (0x01001ac0)

  122. Stack Init fc2a1000 Current fc2a076c Base fc2a1000 Limit fc29d000 Call 0

  123. Priority 9 BasePriority 8 PriorityDecrement 0 DecrementCount 0

  124. ChildEBP RetAddr Args to Child

  125. fc2a0bcc f90a8799 e19a9f50 000000b8 00000190 nt!KefAcquireSpinLockAtDpcLevel+0x3f

  126. fc2a0c14 80424606 fe4c26f0 ffb31d48 ffb35c38 ABCDMA+0x799

  127. fc2a0c2c 80541e77 fe4e3a48 80068f7c 80063418 nt!IopfCallDriver+0x4f

  128. fc2a0c60 8056f9fa ffb361d0 fe4c26f0 0012019f nt!IopCloseFile+0x2b3

  129. fc2a0c90 80493505 ffb361d0 00000001 ffb35c00 nt!ObpDecrementHandleCount+0x1e0

  130. fc2a0d4c 804b19ba 00000070 00ba0018 00000000 nt!NtClose+0x295

  131. fc2a0d4c 77f88583 00000070 00ba0018 00000000 nt!KiSystemService+0x10a

  132. 0006ff1c 77e8a70a 00000070 0006ff80 01001a93 ntdll!NtClose+0xb

  133. 0006ff28 01001a93 00000070 00000000 77fb80db KERNEL32!CloseHandle+0x4f

  134. 0006ff80 01001b93 00000002 006a0200 006a0220 ABCDMA+0x1a93

  135. 0006ffc0 77e87903 ffffffff 0012f88f 7ffdf000 ABCDMA+0x1b93

  136. 0006fff0 00000000 01001ac0 00000000 000000c8 KERNEL32!BaseProcessStart+0x3d

  137. kd> !irp ffb31d48

  138. Irp is active with 2 stacks 2 is current (= 0xffb31ddc)

  139.  No Mdl Thread fe3272f0: Irp stack trace.

  140.      cmd flg cl Device File Completion-Context

  141.  [ 0, 0] 0 0 00000000 00000000 00000000-00000000

  142. Args: 00000000 00000000 00000000 00000000

  143. >[ 12, 0] 0 0 fe4c26f0 ffb35c38 00000000-00000000

  144.         \Driver\ABCDMA   Args: 00000000 00000000 00000000 00000000

  145. kd> *-------------