Re: DbgBreakPoint in WdfRequestCompleteWithInformation when cancelling

Tech-Archive recommends: Fix windows errors by optimizing your registry



you are completing the request with the completion routine set.

0: kd> !wdfrequest 0x7e4cbba0
!IRP 0x81b01c60
!WDFQUEUE 0x7cbc3498
State: Pending, Allocated by WDF for incoming IRP
System Buffer 0x8335c1e0, Length 0x20, !WDFMEMORY 0x7e4cbb39

Cancel or Completion Routine: HifnDrs!DrsEvtRequestCancel (f76eb4b0)

you need to unmark it cancelable (successfully) before completing the request

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:0B72F5BF-F9E0-4C7B-88C8-E5229C483782@xxxxxxxxxxxxxxxx
We are developing a driver using KMDF 1.5 (WDK Rev6000). Now we meet a tricky
DbgBreakPoint when calling the WdfRequestCompleteWithInformation to complete
an IRP which is about to be cancelled.

This is our driver's senario: our driver create a WDFRequest(IRP) for every
incoming WDFRequest(IRP) and send those new created WDFRequests to another
kernel driver. When the newly created wdfrequests have been completed, we
also
complete the corresponding framework built wdfrequest in the complete
routine.
In the cancel routine of the framework built wdfrequest, we don't do
anything except setting some flags in the wdfrequest context.

When we CTRL+C our test application to simulate IRP cancel, the debugger
would
report a DbgBreakPoint when the KMDF verifier is ON. Anyhow, if we omit this
DbgBreakPoint by input g in the debugger, nothing seems wrong. We wonder if
we
did anything wrong in the driver to cause this DbgBreakPoint. Is there anyone
could help us? Thanks!

-George

p.s. Here is what we got from debugger
-------------------------------------------
Break instruction exception - code 80000003 (first chance)
nt!DbgBreakPoint:
80871654 cc int 3
0: kd> !analyze -v
Connected to Windows Server 2003 3790 x86 compatible target, ptr64 FALSE
Loading Kernel Symbols
.................................................................................
.............
Loading User Symbols
............
Loading unloaded module list
........
*******************************************************************************
*
*
* Bugcheck Analysis
*
*
*
*******************************************************************************

Unknown bugcheck code (0)
Unknown bugcheck description
Arguments:
Arg1: 00000000
Arg2: 00000000
Arg3: 00000000
Arg4: 00000000

Debugging Details:
------------------


PROCESS_NAME: drsdemo.exe

FAULTING_IP:
nt!DbgBreakPoint+0
80871654 cc int 3

EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 80871654 (nt!DbgBreakPoint)
ExceptionCode: 80000003 (Break instruction exception)
ExceptionFlags: 00000000
NumberParameters: 3
Parameter[0]: 00000000
Parameter[1]: 81f31db0
Parameter[2]: 00000000

ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION} Breakpoint A breakpoint
has been reached.

DEFAULT_BUCKET_ID: DRIVER_FAULT

BUGCHECK_STR: 0x0

CURRENT_IRQL: 2

LAST_CONTROL_TRANSFER: from f70b236e to 80871654

STACK_TEXT:
f78a2c68 f70b236e f70ed118 81b01cd0 81b34458 nt!DbgBreakPoint
f78a2c98 f70b24d7 f70ed118 81b34458 00000000
Wdf01000!FxRequest::VerifierValidateCompletedRequest+0x9e
f78a2cc0 f70b4938 00000000 00000000 8607f0d0
Wdf01000!FxRequest::CompleteInternal+0x2c
f78a2cdc f70b495c 00000000 00000000 f78a2d08 Wdf01000!FxRequest::Complete+0xb3
f78a2cec f709dfd4 00000000 00000008 81eb22ec
Wdf01000!FxRequest::CompleteWithInformation+0x18
f78a2d08 f76eacdd 81b34458 7e4cbba0 00000000
Wdf01000!imp_WdfRequestCompleteWithInformation+0x7f
f78a2d20 f76ee826 7e4cbba0 00000000 00000008
HifnDrs!WdfRequestCompleteWithInformation+0x1d
[c:\winddk\6000\inc\wdf\kmdf\10\wdfrequest.h @ 848]
f78a2d78 f76eb45a 7e4cbba0 00000000 00000008 HifnDrs!DrsFinishRequest+0x356
f78a2da4 f70ba245 7cb7b368 7cb581d8 81eb22ec
HifnDrs!DrsReqCompleteRoutine+0x1ca
f78a2dcc f70915d3 834847cf 834a7e20 00000000
Wdf01000!FxRequestBase::CompleteSubmitted+0x89
f78a2de8 f709168d 01484c90 8600eed8 f78a2e14
Wdf01000!FxIoTarget::RequestCompletionRoutine+0x195
f78a2df8 8081d119 00000000 83484738 83484c90
Wdf01000!FxIoTarget::_RequestCompletionRoutine+0x35
f78a2e14 8081de7d 00000000 83484738 8600eed8 nt!IopUnloadSafeCompletion+0x1d
f78a2e44 f70e76b4 81ec7f00 f78a2e7c f70b2994 nt!IopfCompleteRequest+0xcd
f78a2e50 f70b2994 00000000 f70ed118 81ec7f00
Wdf01000!FxIrp::CompleteRequest+0x13
f78a2e7c f70b4938 00000000 00000000 860f5300
Wdf01000!FxRequest::CompleteInternal+0x4e9
f78a2e98 f70b495c 00000000 00000000 f78a2ec4 Wdf01000!FxRequest::Complete+0xb3
f78a2ea8 f709dfd4 00000000 00000008 00000000
Wdf01000!FxRequest::CompleteWithInformation+0x18
f78a2ec4 f7107d5d 81ec7f00 7e1380f8 00000000
Wdf01000!imp_WdfRequestCompleteWithInformation+0x7f
f78a2edc f7107c87 7e1380f8 00000000 00000008
HifnDr!WdfRequestCompleteWithInformation+0x1d
[c:\winddk\6000\inc\wdf\kmdf\10\wdfrequest.h @ 848]
f78a2f3c f7103337 860376a8 f7055ef2 f7055ef7 HifnDr!DrRsltHandle+0x647
f78a2f70 f70d79ee 7cb560e0 79fc8b18 ffdffa40 HifnDr!DrEvtInterruptDpc+0x2b7
f78a2f8c f70d7a37 834a9f18 00000000 f78a2ff4
Wdf01000!FxInterrupt::DpcHandler+0x76
f78a2f9c 80831caa 834a9f64 834a9f18 834a9f18
Wdf01000!FxInterrupt::_InterruptDpcThunk+0x13
f78a2ff4 8088cfaf f62cd634 00000000 00000000 nt!KiRetireDpcList+0xca
f78a2ff8 f62cd634 00000000 00000000 00000000 nt!KiDispatchInterrupt+0x3f
WARNING: Frame IP not in any known module. Following frames may be wrong.
8088cfaf 00000000 0000000a bb837775 00000128 0xf62cd634


STACK_COMMAND: kb

FOLLOWUP_IP:
Wdf01000!FxRequest::VerifierValidateCompletedRequest+9e
f70b236e eb12 jmp
Wdf01000!FxRequest::VerifierValidateCompletedRequest+0xb2 (f70b2382)

SYMBOL_STACK_INDEX: 1

SYMBOL_NAME: Wdf01000!FxRequest::VerifierValidateCompletedRequest+9e

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: Wdf01000

IMAGE_NAME: Wdf01000.sys

DEBUG_FLR_IMAGE_TIMESTAMP: 4549b23a

FAILURE_BUCKET_ID:
0x0_Wdf01000!FxRequest::VerifierValidateCompletedRequest+9e

BUCKET_ID: 0x0_Wdf01000!FxRequest::VerifierValidateCompletedRequest+9e

Followup: MachineOwner
---------

0: kd> !wdfrequest 0x7e4cbba0
!IRP 0x81b01c60
!WDFQUEUE 0x7cbc3498
State: Pending, Allocated by WDF for incoming IRP
System Buffer 0x8335c1e0, Length 0x20, !WDFMEMORY 0x7e4cbb39

Cancel or Completion Routine: HifnDrs!DrsEvtRequestCancel (f76eb4b0)
-----------
0: kd> !IRP 0x81b01c60 1
Irp is active with 1 stacks 1 is current (= 0x81b01cd0)
No Mdl: System buffer=8335c1e0: Thread 81f31b40: Irp stack trace.
Flags = 00000030
ThreadListEntry.Flink = 81b01c70
ThreadListEntry.Blink = 81b01c70
IoStatus.Status = 00000000
IoStatus.Information = 00000008
RequestorMode = 00000001
Cancel = 01
CancelIrql = 1
ApcEnvironment = 00
UserIosb = 0087fed8
UserEvent = 00000000
Overlay.AsynchronousParameters.UserApcRoutine = 00000000
Overlay.AsynchronousParameters.UserApcContext = 00000000
Overlay.AllocationSize = 00000000 - 00000000
CancelRoutine = 00000000
UserBuffer = 00000000
&Tail.Overlay.DeviceQueueEntry = 81b01ca0
Tail.Overlay.Thread = 81f31b40
Tail.Overlay.AuxiliaryBuffer = 00000000
Tail.Overlay.ListEntry.Flink = 81ec7a08
Tail.Overlay.ListEntry.Blink = 81b3e5d8
Tail.Overlay.CurrentStackLocation = 81b01cd0
Tail.Overlay.OriginalFileObject = 83362028
Tail.Apc = 00000000
Tail.CompletionKey = 00000000
cmd flg cl Device File Completion-Context
[ e, 0] 5 1 8343dc40 83362028 00000000-00000000 pending
\Driver\HifnDrs
Args: 00000000 00000020 0022e480 00000000
------------------
0: kd> !WDFQUEUE 0x7cbc3498

Dumping WDFQUEUE 0x7cbc3498
=========================
Parallel, Not power-managed, PowerOn, Can accept, Can dispatch,
ExecutionLevelDispatch, SynchronizationScopeNone
Number of driver owned requests: 4
!WDFREQUEST 0x7e5020e0 !IRP 0x81eb3440
!WDFREQUEST 0x7e138b80 !IRP 0x81b3e580
!WDFREQUEST 0x7e4cbba0 !IRP 0x81b01c60
!WDFREQUEST 0x7a801fb0 !IRP 0x81ec79b0
Number of waiting requests: 0

Number of driver owned cancelable requests: 3
!WDFREQUEST 0x7e5020e0 !IRP 0x81eb3440
!WDFREQUEST 0x7e138b80 !IRP 0x81b3e580
!WDFREQUEST 0x7a801fb0 !IRP 0x81ec79b0

Number of driver owned cancelled requests: 1
!WDFREQUEST 0x7e4cbba0 !IRP 0x81b01c60

EvtIoDeviceControl: (0xf76ea230) HifnDrs!DrsEvtIoDeviceControl



.



Relevant Pages

  • Re: WdfRequestSend never completes
    ... can you successfully cancel the io requests? ... endpoint returns TRUE but the corresponding Completion Routine set ... WDFREQUEST 7a383880!irp 0x85c7c668 ...
    (microsoft.public.development.device.drivers)
  • Re: DbgBreakPoint in WdfRequestCompleteWithInformation when cancelling
    ... you are completing the request with a /cancelation/ routine set. ... Cancel or Completion Routine: HifnDrs!DrsEvtRequestCancel ... Number of driver owned requests: ...
    (microsoft.public.development.device.drivers)
  • DbgBreakPoint in WdfRequestCompleteWithInformation when cancelling
    ... DbgBreakPoint when calling the WdfRequestCompleteWithInformation to complete ... This is our driver's senario: our driver create a WDFRequestfor every ... In the cancel routine of the framework built wdfrequest, ... When we CTRL+C our test application to simulate IRP cancel, ...
    (microsoft.public.development.device.drivers)
  • Re: RSVNONR -DB2
    ... Though, given that STOP exists, I agree it is preferable to have two different requests: one for normal termination and one for abnormal termination. ... And there's the fact that FORCE xxx,ARM really is really just a special form of CANCEL and has nothing in common with FORCE other than the name of the command. ... For IBM-MAIN subscribe / signoff / archive access instructions, send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html. ...
    (bit.listserv.ibm-main)
  • Re: [PATCH -mm 4/4][AIO] - Listio support
    ... on the group iocb, then ... Will it be possible to cancel the whole group in one go? ... The purpose of IOCB_CMD_GROUP is to group together the following requests in ... A struct lio_event is added in include/linux/aio.h ...
    (Linux-Kernel)