Is your driver sending IRPs to ksthunk? My guess is that a driver has sent the IRP below to ksthunk, ksthunk returned STATUS_PENDING, and the caller didn’t deal properly with that STATUS_PENDING code (e.g. perhaps it had to wait for the completion, but it didn’t wait).
But this is just a guess, based on the stack trace below. If reviewing the source code that sends IRPs to ksthunk doesn’t produce results, then you could find the address of the problematic IRP in the debugger, examine its contents (e.g. by using !irp), and try to figure out what’s wrong with it and/or its completion event.
Good luck!
Dan
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of uwekirst
Sent: Friday, February 12, 2010 12:12 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] BSOD apc index mismatch
Hi all,
Hello Dan, thank you for your suggestion.
If I enable the driver verifier the bugcheck looks like this.
It crashes in ksthunk.sys.
Any ideas?
thanks,
/Uwe
Microsoft (R) Windows Debugger Version 6.11.0001.404 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
Loading Dump File [C:\Windows\Minidump\021210-20092-01.dmp]
Mini Kernel Dump File: Only registers and stack trace are available
Symbol search path is: C:\Symbols
Executable search path is: C:\Windows
Windows 7 Kernel Version 7600 MP (2 procs) Free x64
Product: WinNt, suite: TerminalServer SingleUserTS
Built by: 7600.16385.amd64fre.win7_rtm.090713-1255
Machine Name:
Kernel base = 0xfffff80002e51000 PsLoadedModuleList = 0xfffff800
0308ee50
Debug session time: Fri Feb 12 17:35:10.062 2010 (GMT+1)
System Uptime: 0 days 0:02:18.136
Loading Kernel Symbols
.
Press ctrl-c (cdb, kd, ntsd) or ctrl-break (windbg) to abort symbol
loads that take too long.
Run !sym noisy before .reload to track down problems loading symbols.
…
…
…
Loading User Symbols
Loading unloaded module list
…
*******************************************************************************
*
*
* Bugcheck
Analysis *
*
*
*******************************************************************************
Use !analyze -v to get detailed debugging information.
BugCheck A, {58, 2, 1, fffff80002ec74d8}
Probably caused by : ksthunk.sys (
ksthunk!CKernelFilterDevice::DeferIrpCompletion+12 )
Followup: MachineOwner
0: kd>
0: kd> !analyze -v
*******************************************************************************
*
*
* Bugcheck
Analysis *
*
*
*******************************************************************************
IRQL_NOT_LESS_OR_EQUAL (a)
An attempt was made to access a pageable (or completely invalid) address
at an
interrupt request level (IRQL) that is too high. This is usually
caused by drivers using improper addresses.
If a kernel debugger is available get the stack backtrace.
Arguments:
Arg1: 0000000000000058, memory referenced
Arg2: 0000000000000002, IRQL
Arg3: 0000000000000001, bitfield :
bit 0 : value 0 = read operation, 1 = write operation
bit 3 : value 0 = not an execute operation, 1 = execute operation
(only on chips which support this level of status)
Arg4: fffff80002ec74d8, address which referenced memory
Debugging Details:
WRITE_ADDRESS: 0000000000000058
CURRENT_IRQL: 2
FAULTING_IP:
nt!KiTryUnwaitThread+28
fffff800`02ec74d8 f0480fba6b4000 lock bts qword ptr [rbx+40h],0
CUSTOMER_CRASH_COUNT: 1
DEFAULT_BUCKET_ID: VERIFIER_ENABLED_VISTA_MINIDUMP
BUGCHECK_STR: 0xA
PROCESS_NAME: audiodg.exe
TRAP_FRAME: fffff880022674b0 – (.trap 0xfffff880022674b0)
NOTE: The trap frame does not contain all registers.
Some register values may be zeroed or incorrect.
rax=fffff88002267858 rbx=0000000000000000 rcx=fffff8000303be80
rdx=fffff98009896fb0 rsi=0000000000000000 rdi=0000000000000000
rip=fffff80002ec74d8 rsp=fffff88002267640 rbp=0000000000000000
r8=0000000000000100 r9=0000000000000000 r10=fffff98009896fb0
r11=fffff98009896fb0 r12=0000000000000000 r13=0000000000000000
r14=0000000000000000 r15=0000000000000000
iopl=0 nv up ei pl zr na po nc
nt!KiTryUnwaitThread+0x28:
fffff80002ec74d8 f0480fba6b4000 lock bts qword ptr [rbx+40h],0 ds:00000000
00000040=???
Resetting default scope
LAST_CONTROL_TRANSFER: from fffff80002ec2469 to fffff80002ec2f00
STACK_TEXT:
fffff88002267368 fffff800
02ec2469 : 000000000000000a 00000000
00000058 0000000000000002 00000000
00000001 : nt!KeBugCheckEx
fffff88002267370 fffff800
02ec10e0 : 0000000000000000 00000000
00000018 0000000000000000 00000000
00000000 :
nt!KiBugCheckDispatch+0x69
fffff880022674b0 fffff800
02ec74d8 : 0000000000000000 00000000
00000018 fffff98009896d30 fffff800
03357b6b : nt!KiPageFault+0x260
fffff88002267640 fffff800
02ec7314 : fffff88002267850 00000000
00000000 0000000000000000 fffff800
0303be80 :
nt!KiTryUnwaitThread+0x28
fffff880022676a0 fffff880
042bf62e : fffff88000000000 fffff980
00000000 fffffa80074a0f00 00000000
0005000e : nt!KeSetEvent+0x484
fffff88002267710 fffff800
0336a5d6 : fffff98009896f68 fffff880
02267850 fffff880022678d0 fffff980
09896d30 :
ksthunk!CKernelFilterDevice::DeferIrpCompletion+0x12
fffff88002267740 fffff800
02ec5516 : fffff98009896f6b fffff800
00000000 0000000000000000 fffff880
00000005 :
nt!IovpLocalCompletionRoutine+0x166
fffff880022677a0 fffff800
0336219f : fffff98009896d30 fffff980
09896f00 fffffa800780d900 00000000
00000000 :
nt!IopfCompleteRequest+0x3a6
fffff88002267880 fffff880
042bf94c : 0000000000000001 fffff980
09896fb0 0000000000000001 fffffa80
0780d920 :
nt!IovCompleteRequest+0x19f
fffff88002267950 fffff800
03368c16 : fffff98009896d30 00000000
00000002 fffffa80c0000005 fffffa80
07d13360 :
ksthunk!CKernelFilterDevice::DispatchIrp+0x244
fffff880022679b0 fffff800
031db3a7 : fffffa800777aea0 fffff880
02267ca0 fffffa800777aea0 fffffa80
076d1740 :
nt!IovCallDriver+0x566
fffff88002267a10 fffff800
031dbc06 : 0000000000d9e3f0 00000000
0000023d 0000000000000000 00000000
00000000 :
nt!IopXxxControlFile+0x607
fffff88002267b40 fffff800
02ec2153 : fffffa800755b710 00000000
00d9e3d8 fffff88002267bc8 00000000
00000001 :
nt!NtDeviceIoControlFile+0x56
fffff88002267bb0 00000000
777eff2a : 0000000000000000 00000000
00000000 0000000000000000 00000000
00000000 :
nt!KiSystemServiceCopyEnd+0x13
0000000000d9e3a8 00000000
00000000 : 0000000000000000 00000000
00000000 0000000000000000 00000000
00000000 : 0x777eff2a
STACK_COMMAND: kb
FOLLOWUP_IP:
ksthunk!CKernelFilterDevice::DeferIrpCompletion+12
fffff880`042bf62e b8160000c0 mov eax,0C0000016h
SYMBOL_STACK_INDEX: 5
SYMBOL_NAME: ksthunk!CKernelFilterDevice::DeferIrpCompletion+12
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: ksthunk
IMAGE_NAME: ksthunk.sys
DEBUG_FLR_IMAGE_TIMESTAMP: 4a5bca93
FAILURE_BUCKET_ID:
X64_0xA_VRF_ksthunk!CKernelFilterDevice::DeferIrpCompletion+12
BUCKET_ID: X64_0xA_VRF_ksthunk!CKernelFilterDevice::DeferIrpCompletion+12
Followup: MachineOwner
0: kd> .trap 0xfffff880022674b0
NOTE: The trap frame does not contain all registers.
Some register values may be zeroed or incorrect.
rax=fffff88002267858 rbx=0000000000000000 rcx=fffff8000303be80
rdx=fffff98009896fb0 rsi=0000000000000000 rdi=0000000000000000
rip=fffff80002ec74d8 rsp=fffff88002267640 rbp=0000000000000000
r8=0000000000000100 r9=0000000000000000 r10=fffff98009896fb0
r11=fffff98009896fb0 r12=0000000000000000 r13=0000000000000000
r14=0000000000000000 r15=0000000000000000
iopl=0 nv up ei pl zr na po nc
nt!KiTryUnwaitThread+0x28:
fffff80002ec74d8 f0480fba6b4000 lock bts qword ptr [rbx+40h],0 ds:00000000
00000040=???
Daniel Mihai schrieb:
Did you try testing your driver with Verifier enabled, on Windows 7 or Vista? Verifier might be able to catch the problem closer to its root cause.
To enable Verifier: “verifier.exe /standard /driver yourdriver.sys” from an Administrator elevated cmd.exe window. At the end of the investigation, you can use “verifier.exe /reset” to disable Verifier.
Dan
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer