I just responded similarly.
-----Original Message-----
From: Graham, Simon [mailto:xxxxx@stratus.com]
Sent: Thursday, August 07, 2003 2:45 PM
To: Kernel Debugging Interest List
Subject: [windbg] RE: finding IRP detail
Unless I’m missing something, driver verifier is reporting that you exited
your dispatch routine CtiIoControl with IRQL different from when you
entered; so this is a problem in your routine that is, presumably, raising
IRQL and neglecting to lower it again.
/simgr
PS: Marybeths arithmetic was, as always, dead on, but in fact is not
required as the !irp command shows you the parameters in each stack location
- it dumps the parameters as 4 longwords, you can then look at ntddk.h to
determine the values relevant to the specific request - in the case of an
IOCTL, the third longword shows the IoControlCode value.
-----Original Message-----
From: xxxxx@yahoo.ca [mailto:xxxxx@yahoo.ca]
Sent: Thursday, August 07, 2003 2:35 PM
To: Kernel Debugging Interest List
Subject: [windbg] RE: finding IRP detail
This is excellent! Your math is absolutely correct.
But the IoControlCode is 0 which is wrong, IRP is completed so its field got
modified, I found it later by experiment.
I have been able to narrow down the analysis from the Information field of
the irp and detected the IOCTL and able to reproduce the problem. Now, I’d
like to back trace the stack. Following is the stack right before before
IoCompleteRequest:
ChildEBP RetAddr Args to Child
fa6a2b60 804eca36 ffbb1040 8192eed8 806ce014 ctibhnp!CtiIoControl+0x1926
(CONV: stdcall) [c:\projects\bhn\driver\port\1000\ioctl.c @ 2148]
fa6a2b70 80647111 8192efac 8192efd0 8115efc0 nt!IopfCallDriver+0x31 (FPO:
[0,0,1])
fa6a2b94 8064f4de 8115ef08 810fa568 00000000 nt!IovCallDriver+0x9e (FPO:
[Non-Fpo])
fa6a2ba4 804eca36 8115ef08 8192eed8 806ce014 nt!ViDriverDispatchGeneric+0x27
(FPO: [2,0,3])
fa6a2bb4 80647111 811f6bc8 8192eed8 00000000 nt!IopfCallDriver+0x31 (FPO:
[0,0,1])
fa6a2bd8 fc95b8ab 811f6bc8 8192eed8 8192efd8 nt!IovCallDriver+0x9e (FPO:
[Non-Fpo])
fa6a2bec fc95baa2 811f6b10 0092eed8 811f6b10
serenum!Serenum_DispatchPassThrough+0x63 (FPO: [Non-Fpo])
fa6a2c10 804eca36 811f6b10 00000000 806ce014 serenum!Serenum_IoCtl+0x70
(FPO: [Non-Fpo])
fa6a2c20 80647111 ffa52230 806cde40 8192eed8 nt!IopfCallDriver+0x31 (FPO:
[0,0,1])
fa6a2c44 8058b076 8192efd8 8122b6f0 8192eed8 nt!IovCallDriver+0x9e (FPO:
[Non-Fpo])
fa6a2c58 8058bc62 811f6b10 8192eed8 8122b6f0
nt!IopSynchronousServiceTail+0x5e (FPO: [Non-Fpo])
fa6a2d00 805987ec 000007a8 0000079c 00000000 nt!IopXxxControlFile+0x5ec
fa6a2d34 804da140 000007a8 0000079c 00000000 nt!NtDeviceIoControlFile+0x28
(FPO: [Non-Fpo])
fa6a2d34 7ffe0304 000007a8 0000079c 00000000 nt!KiSystemService+0xc4 (FPO:
[0,0] TrapFrame @ fa6a2d64)
0012fccc 77f75b1d 77e755d6 000007a8 0000079c
SharedUserData!SystemCallStub+0x4 (FPO: [0,0,0])
0012fcd0 77e755d6 000007a8 0000079c 00000000 ntdll!ZwDeviceIoControlFile+0xc
(FPO: [10,0,0])
0012fd30 004022a5 000007a8 001b0040 00000000 kernel32!DeviceIoControl+0x78
(FPO: [Non-Fpo])
WARNING: Stack unwind information not available. Following frames may be
wrong.
0012fe2c 77d43b37 00401bf0 000300a2 00000111 MTTTY+0x22a5
0012fe94 77d43d91 00000000 00401bf0 000300a2
USER32!UserCallWinProcCheckWow+0x150 (FPO: [Non-Fpo])
0012fef4 77d4438c 0012ff1c 00000001 00401a32
USER32!DispatchMessageWorker+0x306 (FPO: [Non-Fpo])
Following is the call chain for the last frame:
kd> dd fa6a2b58
fa6a2b58 8192ef90 ffbb10f8 fa6a2b94 804eca36
fa6a2b68 ffbb1040 8192eed8 806ce014 80647111
fa6a2b78 8192efac 8192efd0 8115efc0 ffffff00
fa6a2b88 ffffffff ffa35220 8192eed8 fa6a2bd8
fa6a2b98 8064f4de 8115ef08 810fa568 00000000
fa6a2ba8 804eca36 8115ef08 8192eed8 806ce014
fa6a2bb8 80647111 811f6bc8 8192eed8 00000000
fa6a2bc8 ffffff00 ffffffff ffaacf08 8192eed8
Following is the stack right after the return from the function CtiIoControl
by single stepping, the control is now in some part of Os’s kernel code
ChildEBP RetAddr Args to Child
fa6a2b70 80647111 8192efac 8192efd0 8115efc0 nt!IopfCallDriver+0x31 (FPO:
[0,0,1])
fa6a2b94 8064f4de 8115ef08 810fa568 00000000 nt!IovCallDriver+0x9e (FPO:
[Non-Fpo])
fa6a2ba4 804eca36 8115ef08 8192eed8 806ce014 nt!ViDriverDispatchGeneric+0x27
(FPO: [2,0,3])
fa6a2bb4 80647111 811f6bc8 8192eed8 00000000 nt!IopfCallDriver+0x31 (FPO:
[0,0,1])
fa6a2bd8 fc95b8ab 811f6bc8 8192eed8 8192efd8 nt!IovCallDriver+0x9e (FPO:
[Non-Fpo])
fa6a2bec fc95baa2 811f6b10 0092eed8 811f6b10
serenum!Serenum_DispatchPassThrough+0x63 (FPO: [Non-Fpo])
fa6a2c10 804eca36 811f6b10 00000000 806ce014 serenum!Serenum_IoCtl+0x70
(FPO: [Non-Fpo])
fa6a2c20 80647111 ffa52230 806cde40 8192eed8 nt!IopfCallDriver+0x31 (FPO:
[0,0,1])
fa6a2c44 8058b076 8192efd8 8122b6f0 8192eed8 nt!IovCallDriver+0x9e (FPO:
[Non-Fpo])
fa6a2c58 8058bc62 811f6b10 8192eed8 8122b6f0
nt!IopSynchronousServiceTail+0x5e (FPO: [Non-Fpo])
fa6a2d00 805987ec 000007a8 0000079c 00000000 nt!IopXxxControlFile+0x5ec
fa6a2d34 804da140 000007a8 0000079c 00000000 nt!NtDeviceIoControlFile+0x28
(FPO: [Non-Fpo])
fa6a2d34 7ffe0304 000007a8 0000079c 00000000 nt!KiSystemService+0xc4 (FPO:
[0,0] TrapFrame @ fa6a2d64)
0012fccc 77f75b1d 77e755d6 000007a8 0000079c
SharedUserData!SystemCallStub+0x4 (FPO: [0,0,0])
0012fcd0 77e755d6 000007a8 0000079c 00000000 ntdll!ZwDeviceIoControlFile+0xc
(FPO: [10,0,0])
0012fd30 004022a5 000007a8 001b0040 00000000 kernel32!DeviceIoControl+0x78
(FPO: [Non-Fpo])
WARNING: Stack unwind information not available. Following frames may be
wrong.
0012fe2c 77d43b37 00401bf0 000300a2 00000111 MTTTY+0x22a5
0012fe94 77d43d91 00000000 00401bf0 000300a2
USER32!UserCallWinProcCheckWow+0x150 (FPO: [Non-Fpo])
0012fef4 77d4438c 0012ff1c 00000001 00401a32
USER32!DispatchMessageWorker+0x306 (FPO: [Non-Fpo])
0012ff00 00401a32 0012ff1c 77f517e6 0012ffc0 USER32!DispatchMessageA+0xb
(FPO: [1,0,0])
Alas, the function call of my driver vanished from the stack. If I do a dd
around the last frame of previous stack I find that EBP is now 0 which makes
sense why it is vanished.
kd> dd fa6a2b58
fa6a2b58 8115ef00 fa6a2b94 00000000 804eca36
fa6a2b68 00000008 00000206 806ce014 80647111
fa6a2b78 8192efac 8192efd0 8115efc0 ffffff00
fa6a2b88 ffffffff ffa35220 8192eed8 fa6a2bd8
fa6a2b98 8064f4de 8115ef08 810fa568 00000000
fa6a2ba8 804eca36 8115ef08 8192eed8 806ce014
fa6a2bb8 80647111 811f6bc8 8192eed8 00000000
fa6a2bc8 ffffff00 ffffffff ffaacf08 8192eed8
If I step through more it’ll bugcheck. At this point I’d like to find the
frame whcih was:
fa6a2b60 804eca36 ffbb1040 8192eed8 806ce014 ctibhnp!CtiIoControl+0x1926
(CONV: stdcall) [c:\projects\bhn\driver\port\1000\ioctl.c @ 2148]
I have ‘Stacking the Deck’ (The NT Insider, Nov-Dec, 2002) open in front of
me, yet if you could give me some quick hints that will be great.
Thanks,
Hablu
Well, it would be trivial if your CurrentStackLocation pointed to your
driver’s SP. Then you could use “dt IO_STACK_LOCATION” on that address.
So, using dt, I was able to establish that the IRP is 0x70 bytes, and each
stack location is 0x24. So, I think your drivers SP would be at
8193aed8+70+24+24. Try “dt IO_STACK_LOCATION” on that address.
Let me know if this works. I hope my math isn’t off…
Marybeth Croci
Stratus Technologies
-----Original Message-----
From: xxxxx@yahoo.ca [mailto:xxxxx@yahoo.ca]
Sent: Wednesday, August 06, 2003 12:12 PM
To: Kernel Debugging Interest List
Subject: [windbg] finding IRP detail
Hello,
I was running DC2 from HCT 11.2. I got a bugcheck of IRQL not same before
and after IoCallDriver. The bugcheck came with a different driver. I know
the problem is with my driver and it is most probably with spin locks not
released . From the stack I get the IRP address related to my driver from
IovCallDriver argument. Then I use !irp to get detail info. My driver is
\Driver\CTIBHNPort. I can’t find any way to know the IoControlCode of this
IRP, if I know this I can analyse the related code. Any hint or suggestion
will be greatly appreciated.
Thanks,
Hablu
You are currently subscribed to windbg as: xxxxx@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
You are currently subscribed to windbg as: xxxxx@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com