Hello,
i am writing a virtual USB bus driver. The bus driver
enumerates a composite device (Canon MP810 Multifunction printer).
When the printer is switched off my bus driver calls the function
IoInvalidateRelations for the type BusRelation and in the following
IRP_MN_QUERY_DEVICE_RELATIONS the driver reports that no device
is present on the bus.
The upper driver’s cancel all outstanding IPRs with the cancel routine
of the bus driver and/or called URB_FUNCTION_ABORT_PIPE for every pipe.
At this moment the IRP queue for the composite device is empty.
For the IRP_MN_SURPRISE_REMOVAL request my bus driver deactivates the
device interface and for IRP_MN_REMOVE_DEVICE the driver deletes the device object.
The effect is a BSOD.
Can somebody give me a hint.
Thank you very much for all tip’s.
Best Regards,
Stefan Witt
*** Fatal System Error: 0x0000000a
(0x00000004,0x00000002,0x00000000,0x805314A6)
Break instruction exception - code 80000003 (first chance)
A fatal system error has occurred.
Debugger entered on first try; Bugcheck callbacks have not been invoked.
A fatal system error has occurred.
Connected to Windows XP 2600 x86 compatible target, ptr64 FALSE
Loading Kernel Symbols
…
Loading User Symbols
Loading unloaded module list
…
*******************************************************************************
* *
* Bugcheck Analysis *
* *
*******************************************************************************
Use !analyze -v to get detailed debugging information.
BugCheck A, {4, 2, 0, 805314a6}
*** No owner thread found for resource 80558460
*** No owner thread found for resource 805584e0
*** No owner thread found for resource 80558460
*** No owner thread found for resource 805584e0
*** No owner thread found for resource 80558460
*** No owner thread found for resource 805584e0
Probably caused by : ntoskrnl.exe ( nt!PpDevNodeRemoveFromTree+26 )
Followup: MachineOwner
nt!RtlpBreakWithStatusInstruction:
804e3592 cc int 3
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: 00000004, memory referenced
Arg2: 00000002, IRQL
Arg3: 00000000, 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: 805314a6, address which referenced memory
Debugging Details:
*** No owner thread found for resource 80558460
*** No owner thread found for resource 805584e0
*** No owner thread found for resource 80558460
*** No owner thread found for resource 805584e0
*** No owner thread found for resource 80558460
*** No owner thread found for resource 805584e0
READ_ADDRESS: 00000004
CURRENT_IRQL: 2
FAULTING_IP:
nt!PpDevNodeRemoveFromTree+26
805314a6 3931 cmp dword ptr [ecx],esi
DEFAULT_BUCKET_ID: DRIVER_FAULT
BUGCHECK_STR: 0xA
PROCESS_NAME: System
TRAP_FRAME: f88eeba4 – (.trap 0xfffffffff88eeba4)
ErrCode = 00000000
eax=00000000 ebx=80558518 ecx=00000004 edx=804dc8c1 esi=82018b78 edi=80558080
eip=805314a6 esp=f88eec18 ebp=f88eec28 iopl=0 nv up ei pl nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010202
nt!PpDevNodeRemoveFromTree+0x26:
805314a6 3931 cmp dword ptr [ecx],esi ds:0023:00000004=???
Resetting default scope
LOCK_ADDRESS: 80558460 – (!locks 80558460)
Resource @ nt!PiEngineLock (0x80558460) Exclusively owned
Contention Count = 4
Threads: 822dc3c8-01<*>
1 total locks, 1 locks currently held
PNP_TRIAGE:
Lock address : 0x80558460
Thread Count : 0
Thread address: 0x00000000
Thread wait : 0x0
LAST_CONTROL_TRANSFER: from 8053225b to 804e3592
STACK_TEXT:
f88ee758 8053225b 00000003 f88eeab4 00000000 nt!RtlpBreakWithStatusInstruction
f88ee7a4 80532d2e 00000003 00000004 805314a6 nt!KiBugCheckDebugBreak+0x19
f88eeb84 804e187f 0000000a 00000004 00000002 nt!KeBugCheck2+0x574
f88eeb84 805314a6 0000000a 00000004 00000002 nt!KiTrap0E+0x233
f88eec28 8061b5d3 82018b78 805584a0 81fabd20 nt!PpDevNodeRemoveFromTree+0x26
f88eec48 8061b90f 821b9618 e1a1a540 00000000 nt!IopUnlinkDeviceRemovalRelations+0x85
f88eec68 8061ba10 81fabd20 00000000 81ff10e8 nt!IopDelayedRemoveWorker+0x5c
f88eec80 80530651 821b9618 00000001 e1b82d60 nt!IopChainDereferenceComplete+0xd9
f88eecac 8061d893 81fc05f0 00000006 00000000 nt!IopNotifyPnpWhenChainDereferenced+0xa1
f88eed34 805ec65b f88eed70 806ed188 e100eb38 nt!PiProcessQueryRemoveAndEject+0x9e4
f88eed50 8059c423 f88eed70 82200140 8056147c nt!PiProcessTargetDeviceEvent+0x2a
f88eed74 804e426b 82200140 00000000 822dc3c8 nt!PiWalkDeviceList+0x122
f88eedac 8057be15 82200140 00000000 00000000 nt!ExpWorkerThread+0x100
f88eeddc 804fa4da 804e4196 00000001 00000000 nt!PspSystemThreadStartup+0x34
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16
STACK_COMMAND: kb
FOLLOWUP_IP:
nt!PpDevNodeRemoveFromTree+26
805314a6 3931 cmp dword ptr [ecx],esi
SYMBOL_STACK_INDEX: 4
SYMBOL_NAME: nt!PpDevNodeRemoveFromTree+26
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: nt
IMAGE_NAME: ntoskrnl.exe
DEBUG_FLR_IMAGE_TIMESTAMP: 42250ff9
FAILURE_BUCKET_ID: 0xA_VRF_nt!PpDevNodeRemoveFromTree+26
BUCKET_ID: 0xA_VRF_nt!PpDevNodeRemoveFromTree+26