Hi, I have a driver. It caused the the software autocad to hung when opening a file from network disk. If my driver ignore IRP_MJ_DIRECTORY_CONTROL, then no hung happens.
I did some debugging, but still no clue about it. what I understand are:
- it seems no deadlock
- it seems the software is waiting for completion of cancel operation. but it never happen.
Could you kindly give me some help?
Thanks,
Xin
1: kd> !THREAD 895f3020
THREAD 895f3020 Cid 08e4.081c Teb: 7ffdd000 Win32Thread: e45cdc60 WAIT: (Executive) KernelMode Non-Alertable
895df524 NotificationEvent
IRP List:
8963d400: (0006,01d8) Flags: 00000800 Mdl: 89604b80
Not impersonating
DeviceMap e6d69bb0
Owning Process 0 Image:
Attached Process 895bc900 Image: acad.exe
Wait Start TickCount 323078 Ticks: 28836 (0:00:07:30.562)
Context Switch Count 8941 IdealProcessor: 0 LargeStack
UserTime 00:00:00.812
KernelTime 00:00:01.203
Win32 Start Address 0x00a89e50
Start Address 0x7c8106b5
Stack Init b553c000 Current b553bc78 Base b553c000 Limit b5539000 Call 0
Priority 10 BasePriority 8 PriorityDecrement 0 DecrementCount 16
ChildEBP RetAddr Args to Child
b553bc90 8050480e 895f3090 895f3020 804fc042 nt!KiSwapContext+0x2f (FPO: [Uses EBP] [0,0,4])
b553bcc4 8057db0a 00000000 00000000 00000000 nt!KiSwapThread+0x8a (FPO: [0,0,0])
b553bcf0 8057f8b3 005df524 8963d400 b553bd64 nt!IopCancelAlertedRequest+0x68 (FPO: [Non-Fpo])
b553bd0c 80579dcb 89f822e0 00000103 895df4c8 nt!IopSynchronousServiceTail+0x103 (FPO: [Non-Fpo])
b553bd30 805423fc 00000518 00000000 00000000 nt!NtQueryDirectoryFile+0x5d (FPO: [Non-Fpo])
b553bd30 7c92eb94 00000518 00000000 00000000 nt!KiFastCallEntry+0xfc (FPO: [0,0] TrapFrame @ b553bd64)
WARNING: Frame IP not in any known module. Following frames may be wrong.
0012e8f4 00000000 00000000 00000000 00000000 0x7c92eb94
1: kd> .thread 895f3020
Implicit thread is now 895f3020
1: kd> kv
Stack trace for last set context - .thread/.cxr resets it
ChildEBP RetAddr Args to Child
b553bc90 8050480e 895f3090 895f3020 804fc042 nt!KiSwapContext+0x2f (FPO: [Uses EBP] [0,0,4])
b553bcc4 8057db0a 00000000 00000000 00000000 nt!KiSwapThread+0x8a (FPO: [0,0,0])
b553bcf0 8057f8b3 005df524 8963d400 b553bd64 nt!IopCancelAlertedRequest+0x68 (FPO: [Non-Fpo])
b553bd0c 80579dcb 89f822e0 00000103 895df4c8 nt!IopSynchronousServiceTail+0x103 (FPO: [Non-Fpo])
b553bd30 805423fc 00000518 00000000 00000000 nt!NtQueryDirectoryFile+0x5d (FPO: [Non-Fpo])
b553bd30 7c92eb94 00000518 00000000 00000000 nt!KiFastCallEntry+0xfc (FPO: [0,0] TrapFrame @ b553bd64)
WARNING: Frame IP not in any known module. Following frames may be wrong.
0012e8f4 00000000 00000000 00000000 00000000 0x7c92eb94
1: kd> !irp 895df4c8
IRP signature does not match, probably not an IRP. Use any flag to force.
1: kd> !irp b553bd64
IRP signature does not match, probably not an IRP. Use any flag to force.
1: kd> !irp 8963d400
Irp is active with 5 stacks 7 is current (= 0x8963d548)
Mdl=89604b80: No System Buffer: Thread 895f3020: Irp is completed.
cmd flg cl Device File Completion-Context
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[c, 0] 0 0 8a6593b8 00000000 ba5d97de-89ab7ad8
\FileSystem\MRxSmb fltMgr!FltpPassThroughCompletion
Args: 00000000 00000000 00000000 00000000
[c, 0] 0 0 8a810820 00000000 ba57c77a-b553bc7c
\FileSystem\FltMgr twayblade
Args: 00000000 00000000 00000000 00000000
[c, 0] 0 0 89fa3e80 00000000 00000000-00000000
\FileSystem\twayblade
Args: 00000000 00000000 00000000 00000000
1: kd> !irp 8963d400 1
Irp is active with 5 stacks 7 is current (= 0x8963d548)
Mdl=89604b80: No System Buffer: Thread 895f3020: Irp is completed.
Flags = 00000800
ThreadListEntry.Flink = 895f3230
ThreadListEntry.Blink = 895f3230
IoStatus.Status = 00000000
IoStatus.Information = 00000098
RequestorMode = 00000001
Cancel = 01
CancelIrql = 0
ApcEnvironment = 00
UserIosb = 0012e658
UserEvent = 00000000
Overlay.AsynchronousParameters.UserApcRoutine = 00000000
Overlay.AsynchronousParameters.UserApcContext = 00000000
Overlay.AllocationSize = 00000000 - 00000000
CancelRoutine = 00000000
UserBuffer = 0012e688
&Tail.Overlay.DeviceQueueEntry = 8963d440
Tail.Overlay.Thread = 895f3020
Tail.Overlay.AuxiliaryBuffer = 00000000
Tail.Overlay.ListEntry.Flink = 00000000
Tail.Overlay.ListEntry.Blink = 00000000
Tail.Overlay.CurrentStackLocation = 8963d548
Tail.Overlay.OriginalFileObject = 895df4c8
Tail.Apc = 00000000
Tail.CompletionKey = 00000000
cmd flg cl Device File Completion-Context
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[c, 0] 0 0 8a6593b8 00000000 ba5d97de-89ab7ad8
\FileSystem\MRxSmb fltMgr!FltpPassThroughCompletion
Args: 00000000 00000000 00000000 00000000
[c, 0] 0 0 8a810820 00000000 ba57c77a-b553bc7c
\FileSystem\FltMgr twayblade
Args: 00000000 00000000 00000000 00000000
[c, 0] 0 0 89fa3e80 00000000 00000000-00000000
\FileSystem\twayblade
Args: 00000000 00000000 00000000 00000000
1: kd> !locks
* DUMP OF ALL RESOURCE OBJECTS
KD: Scanning for held locks…
Resource @ 0x899a0278 Shared 1 owning threads
Threads: 8a888833-01<> Actual Thread 8a888830
Resource @ 0x8998b7d0 Shared 1 owning threads
Threads: 8a888833-01<> Actual Thread 8a888830
KD: Scanning for held locks…
Resource @ 0x89c7d7e8 Shared 1 owning threads
Threads: 8a888d23-01<> Actual Thread 8a888d20
KD: Scanning for held locks…
Resource @ 0x89b17588 Shared 1 owning threads
Threads: 8a888aab-01<> Actual Thread 8a888aa8
KD: Scanning for held locks.
Resource @ 0x89a1b8e0 Shared 1 owning threads
Threads: 89c665c3-01<> Actual Thread 89c665c0
KD: Scanning for held locks.
23292 total locks, 5 locks currently held
1: kd> !locks -v 0x899a0278
Resource @ 0x899a0278 Shared 1 owning threads
Threads: 8a888833-01<*> *** Actual Thread 8a888830
THREAD 8a888830 Cid 0004.0018 Teb: 00000000 Win32Thread: 00000000 WAIT: (WrQueue) UserMode Non-Alertable
80564820 Unknown
Not impersonating
DeviceMap e1000130
Owning Process 0 Image:
Attached Process 8a8899c8 Image: System
Wait Start TickCount 351908 Ticks: 6 (0:00:00:00.093)
Context Switch Count 14118 IdealProcessor: 0
UserTime 00:00:00.000
KernelTime 00:00:00.109
Start Address nt!ExpWorkerThread (0x80539458)
Stack Init bace4000 Current bace3d24 Base bace4000 Limit bace1000 Call 0
Priority 13 BasePriority 13 PriorityDecrement 0 DecrementCount 16
ChildEBP RetAddr
bace3d3c 8050480e nt!KiSwapContext+0x2f (FPO: [Uses EBP] [0,0,4])
bace3d74 80539524 nt!KiSwapThread+0x8a (FPO: [0,0,0])
bace3dac 805cfc9e nt!ExpWorkerThread+0xcc (FPO: [Non-Fpo])
bace3ddc 80546ebe nt!PspSystemThreadStartup+0x34 (FPO: [Non-Fpo])
00000000 00000000 nt!KiThreadStartup+0x16
1 total locks, 1 locks currently held