BSOD with DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver

Hi All,

When I tried to install my Intermediate driver, right after Driver Entry I’m seeing BSOD. This happens only when there is a trend micro filter driver (antivirus) software is enabled.
Below are the BSOD logs. Can anybody help me to debug this crash.

Use !analyze -v to get detailed debugging information.

BugCheck CE, {f4c72680, 8, f4c72680, 0}

Probably caused by : bnadimd5.sys ( bnadimd5+2680 )

Followup: MachineOwner

nt!RtlpBreakWithStatusInstruction:
807584dc cc int 3
kd> !analyze -v
*******************************************************************************
* *
* Bugcheck Analysis *
* *
*******************************************************************************

DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS (ce)
A driver unloaded without cancelling timers, DPCs, worker threads, etc.
The broken driver’s name is displayed on the screen.
Arguments:
Arg1: f4c72680, memory referenced
Arg2: 00000008, value 0 = read operation, 1 = write operation
Arg3: f4c72680, If non-zero, the instruction address which referenced the bad memory
address.
Arg4: 00000000, Mm internal code.

Debugging Details:

WRITE_ADDRESS: f4c72680

FAULTING_IP:
bnadimd5+2680
f4c72680 ?? ???

DEFAULT_BUCKET_ID: DRIVER_FAULT

BUGCHECK_STR: 0xCE

PROCESS_NAME: System

CURRENT_IRQL: 1

TRAP_FRAME: f5b2ab80 – (.trap 0xfffffffff5b2ab80)
ErrCode = 00000010
eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334 edi=87418350
eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010246
<unloaded_bnadimd5.sys>+0x2680:
f4c72680 ?? ???
Resetting default scope

IP_MODULE_UNLOADED:
bnadimd5+2680
f4c72680 ?? ???

LAST_CONTROL_TRANSFER: from 806377bf to 807584dc

STACK_TEXT:
f5b2a6f0 806377bf 00000003 00000000 00000000 nt!RtlpBreakWithStatusInstruction
f5b2a73c 80638743 00000003 c07a6390 00000000 nt!KiBugCheckDebugBreak+0x19
f5b2aad4 80638b7d 00000050 f4c72680 00000008 nt!KeBugCheck2+0x5e1
f5b2aaf4 8070f3b1 00000050 f4c72680 00000008 nt!KeBugCheckEx+0x1b
f5b2ab68 8077ad54 00000008 f4c72680 00000000 nt!MmAccessFault+0x1bd3
f5b2ab68 f4c72680 00000008 f4c72680 00000000 nt!KiTrap0E+0xe4
WARNING: Frame IP not in any known module. Following frames may be wrong.
f5b2abf0 f6f0a9d5 f5b2ac80 f5b2ac18 87838334 <unloaded_bnadimd5.sys>+0x2680
f5b2ac84 f6f0d073 87418350 8760d518 80bbf460 NDIS!ndisInitializeBinding+0x1a1
f5b2ad0c f6f15a03 87418350 87397008 87397098 NDIS!ndisCheckAdapterBindings+0xf5
f5b2ad94 f6f08df5 87397008 00000000 86d89020 NDIS!ndisCheckProtocolBindings+0x13d
f5b2adac 80a0041e 87397088 00000000 00000000 NDIS!ndisWorkerThread+0xdd
f5b2addc 8077cb86 f6f08d18 87397088 00000000 nt!PspSystemThreadStartup+0x2e
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16

STACK_COMMAND: kb

FOLLOWUP_IP:
bnadimd5+2680
f4c72680 ?? ???

SYMBOL_STACK_INDEX: 6

SYMBOL_NAME: bnadimd5+2680

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: bnadimd5

IMAGE_NAME: bnadimd5.sys

DEBUG_FLR_IMAGE_TIMESTAMP: 0

FAILURE_BUCKET_ID: 0xCE_W_bnadimd5+2680

BUCKET_ID: 0xCE_W_bnadimd5+2680

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

kd> .trap 0xfffffffff5b2ab80
ErrCode = 00000010
eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334 edi=87418350
eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010246
<unloaded_bnadimd5.sys>+0x2680:
f4c72680 ?? ???

thanks
satheesh</unloaded_bnadimd5.sys></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys>

What driver is bnadimd5.sys? Yours?

Turn on driver verifier for your driver *and* NDIS.SYS. Turn it on for the
3rd party driver too.

The bugcheck is (as it says) a case where a module has been unloaded
(bnadimd5.sys) yet a callback occurred (or return through a call occurred)
in that driver.

The driver did not correctly synchronize its and allowed itself to be
unloaded when it was not safe to do so. The crash occurred *after* the
unload. Since you don’t say exactly all of what you were doing, it could
be that you had installed your IM driver and that it was being loaded /
unloaded / reloaded. It might be that the unload prior to the load is where
the real problem is.

Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Friday, February 13, 2009 6:01 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] BSOD with
DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver

Hi All,

When I tried to install my Intermediate driver, right after Driver Entry I’m
seeing BSOD. This happens only when there is a trend micro filter driver
(antivirus) software is enabled.
Below are the BSOD logs. Can anybody help me to debug this crash.

Use !analyze -v to get detailed debugging information.

BugCheck CE, {f4c72680, 8, f4c72680, 0}

Probably caused by : bnadimd5.sys ( bnadimd5+2680 )

Followup: MachineOwner

nt!RtlpBreakWithStatusInstruction:
807584dc cc int 3
kd> !analyze -v
****************************************************************************
***
*
*
* Bugcheck Analysis
*
*
*
****************************************************************************
***

DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS (ce)
A driver unloaded without cancelling timers, DPCs, worker threads, etc.
The broken driver’s name is displayed on the screen.
Arguments:
Arg1: f4c72680, memory referenced
Arg2: 00000008, value 0 = read operation, 1 = write operation
Arg3: f4c72680, If non-zero, the instruction address which referenced the
bad memory
address.
Arg4: 00000000, Mm internal code.

Debugging Details:

WRITE_ADDRESS: f4c72680

FAULTING_IP:
bnadimd5+2680
f4c72680 ?? ???

DEFAULT_BUCKET_ID: DRIVER_FAULT

BUGCHECK_STR: 0xCE

PROCESS_NAME: System

CURRENT_IRQL: 1

TRAP_FRAME: f5b2ab80 – (.trap 0xfffffffff5b2ab80)
ErrCode = 00000010
eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
edi=87418350
eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
efl=00010246
<unloaded_bnadimd5.sys>+0x2680:
f4c72680 ?? ???
Resetting default scope

IP_MODULE_UNLOADED:
bnadimd5+2680
f4c72680 ?? ???

LAST_CONTROL_TRANSFER: from 806377bf to 807584dc

STACK_TEXT:
f5b2a6f0 806377bf 00000003 00000000 00000000
nt!RtlpBreakWithStatusInstruction
f5b2a73c 80638743 00000003 c07a6390 00000000 nt!KiBugCheckDebugBreak+0x19
f5b2aad4 80638b7d 00000050 f4c72680 00000008 nt!KeBugCheck2+0x5e1
f5b2aaf4 8070f3b1 00000050 f4c72680 00000008 nt!KeBugCheckEx+0x1b
f5b2ab68 8077ad54 00000008 f4c72680 00000000 nt!MmAccessFault+0x1bd3
f5b2ab68 f4c72680 00000008 f4c72680 00000000 nt!KiTrap0E+0xe4
WARNING: Frame IP not in any known module. Following frames may be wrong.
f5b2abf0 f6f0a9d5 f5b2ac80 f5b2ac18 87838334 <unloaded_bnadimd5.sys>+0x2680
f5b2ac84 f6f0d073 87418350 8760d518 80bbf460
NDIS!ndisInitializeBinding+0x1a1
f5b2ad0c f6f15a03 87418350 87397008 87397098
NDIS!ndisCheckAdapterBindings+0xf5
f5b2ad94 f6f08df5 87397008 00000000 86d89020
NDIS!ndisCheckProtocolBindings+0x13d
f5b2adac 80a0041e 87397088 00000000 00000000 NDIS!ndisWorkerThread+0xdd
f5b2addc 8077cb86 f6f08d18 87397088 00000000 nt!PspSystemThreadStartup+0x2e
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16

STACK_COMMAND: kb

FOLLOWUP_IP:
bnadimd5+2680
f4c72680 ?? ???

SYMBOL_STACK_INDEX: 6

SYMBOL_NAME: bnadimd5+2680

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: bnadimd5

IMAGE_NAME: bnadimd5.sys

DEBUG_FLR_IMAGE_TIMESTAMP: 0

FAILURE_BUCKET_ID: 0xCE_W_bnadimd5+2680

BUCKET_ID: 0xCE_W_bnadimd5+2680

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

kd> .trap 0xfffffffff5b2ab80
ErrCode = 00000010
eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
edi=87418350
eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
efl=00010246
<unloaded_bnadimd5.sys>+0x2680:
f4c72680 ?? ???

thanks
satheesh


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</unloaded_bnadimd5.sys></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys>

Dave,

bnadimd5.sys is my driver which is under development. What I’m doing is thru
notify object DLL (took the one from sample MUL driver) installing my
Intermediate driver. I can see my driver entry gets called but after that it
immediately crashes.

Point here is, I won’t see the crash if there is no TrendMicro
Software(antivirus software) installed in the system. BSOD occurs only when
the TrendMicro Software is present.

Protocolbindadapter itself is not get called. BSOD occurs prior to that.

Any clue?

Regards
Satheesh

On Fri, Feb 13, 2009 at 3:38 PM, David R. Cattley wrote:

> What driver is bnadimd5.sys? Yours?
>
> Turn on driver verifier for your driver and NDIS.SYS. Turn it on for
> the
> 3rd party driver too.
>
> The bugcheck is (as it says) a case where a module has been unloaded
> (bnadimd5.sys) yet a callback occurred (or return through a call occurred)
> in that driver.
>
> The driver did not correctly synchronize its and allowed itself to be
> unloaded when it was not safe to do so. The crash occurred after the
> unload. Since you don’t say exactly all of what you were doing, it could
> be that you had installed your IM driver and that it was being loaded /
> unloaded / reloaded. It might be that the unload prior to the load is
> where
> the real problem is.
>
> Good Luck,
> Dave Cattley
> Consulting Engineer
> Systems Software Development
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> xxxxx@gmail.com
> Sent: Friday, February 13, 2009 6:01 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] BSOD with
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver
>
> Hi All,
>
> When I tried to install my Intermediate driver, right after Driver Entry
> I’m
> seeing BSOD. This happens only when there is a trend micro filter driver
> (antivirus) software is enabled.
> Below are the BSOD logs. Can anybody help me to debug this crash.
>
>
> Use !analyze -v to get detailed debugging information.
>
> BugCheck CE, {f4c72680, 8, f4c72680, 0}
>
>
>
>
>
> Probably caused by : bnadimd5.sys ( bnadimd5+2680 )
>
> Followup: MachineOwner
> ---------
>
> nt!RtlpBreakWithStatusInstruction:
> 807584dc cc int 3
> kd> !analyze -v
>
> *************************************************************************
>

> *
> *
> * Bugcheck Analysis
> *
> *
> *
>
> *************************************************************************
>

>
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS (ce)
> A driver unloaded without cancelling timers, DPCs, worker threads, etc.
> The broken driver’s name is displayed on the screen.
> Arguments:
> Arg1: f4c72680, memory referenced
> Arg2: 00000008, value 0 = read operation, 1 = write operation
> Arg3: f4c72680, If non-zero, the instruction address which referenced the
> bad memory
> address.
> Arg4: 00000000, Mm internal code.
>
> Debugging Details:
> ------------------
>
>
>
>
>
>
> WRITE_ADDRESS: f4c72680
>
> FAULTING_IP:
> bnadimd5+2680
> f4c72680 ?? ???
>
> DEFAULT_BUCKET_ID: DRIVER_FAULT
>
> BUGCHECK_STR: 0xCE
>
> PROCESS_NAME: System
>
> CURRENT_IRQL: 1
>
> TRAP_FRAME: f5b2ab80 – (.trap 0xfffffffff5b2ab80)
> ErrCode = 00000010
> eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
> edi=87418350
> eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
> nc
> cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
> efl=00010246
> <unloaded_bnadimd5.sys>+0x2680:
> f4c72680 ?? ???
> Resetting default scope
>
> IP_MODULE_UNLOADED:
> bnadimd5+2680
> f4c72680 ?? ???
>
> LAST_CONTROL_TRANSFER: from 806377bf to 807584dc
>
> STACK_TEXT:
> f5b2a6f0 806377bf 00000003 00000000 00000000
> nt!RtlpBreakWithStatusInstruction
> f5b2a73c 80638743 00000003 c07a6390 00000000 nt!KiBugCheckDebugBreak+0x19
> f5b2aad4 80638b7d 00000050 f4c72680 00000008 nt!KeBugCheck2+0x5e1
> f5b2aaf4 8070f3b1 00000050 f4c72680 00000008 nt!KeBugCheckEx+0x1b
> f5b2ab68 8077ad54 00000008 f4c72680 00000000 nt!MmAccessFault+0x1bd3
> f5b2ab68 f4c72680 00000008 f4c72680 00000000 nt!KiTrap0E+0xe4
> WARNING: Frame IP not in any known module. Following frames may be wrong.
> f5b2abf0 f6f0a9d5 f5b2ac80 f5b2ac18 87838334 <unloaded_bnadimd5.sys>+0x2680
> f5b2ac84 f6f0d073 87418350 8760d518 80bbf460
> NDIS!ndisInitializeBinding+0x1a1
> f5b2ad0c f6f15a03 87418350 87397008 87397098
> NDIS!ndisCheckAdapterBindings+0xf5
> f5b2ad94 f6f08df5 87397008 00000000 86d89020
> NDIS!ndisCheckProtocolBindings+0x13d
> f5b2adac 80a0041e 87397088 00000000 00000000 NDIS!ndisWorkerThread+0xdd
> f5b2addc 8077cb86 f6f08d18 87397088 00000000 nt!PspSystemThreadStartup+0x2e
> 00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16
>
>
> STACK_COMMAND: kb
>
> FOLLOWUP_IP:
> bnadimd5+2680
> f4c72680 ?? ???
>
> SYMBOL_STACK_INDEX: 6
>
> SYMBOL_NAME: bnadimd5+2680
>
> FOLLOWUP_NAME: MachineOwner
>
> MODULE_NAME: bnadimd5
>
> IMAGE_NAME: bnadimd5.sys
>
> DEBUG_FLR_IMAGE_TIMESTAMP: 0
>
> FAILURE_BUCKET_ID: 0xCE_W_bnadimd5+2680
>
> BUCKET_ID: 0xCE_W_bnadimd5+2680
>
> Followup: MachineOwner
> ---------
>
> kd> .trap 0xfffffffff5b2ab80
> ErrCode = 00000010
> eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
> edi=87418350
> eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
> nc
> cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
> efl=00010246
> <unloaded_bnadimd5.sys>+0x2680:
> f4c72680 ?? ???
>
> thanks
> satheesh
>
>
> —
> 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
>
>
> —
> 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
></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys>

Satheesh,

Yes, I have a clue. Better, you provided *evidence* that the problem is
with your driver. Windows has identified that your driver unloaded from
memory while it was still possible (neah, actual) that a code execution path
could occur through where your driver was previously loaded. This can only
occur because your driver left behind:

  1. A timer.

  2. A DPC

  3. A work item.

  4. A callback registered with another driver.

  5. Etc., etc.

Now regardless of the vindication you might feel that it only happens
because driver is loaded and when you remove driver it
no longer happens, that is not nearly as strong a bit of evidence as the
crash dump saying your (now unloaded) driver is in the code path.

The driver is simply changing the test so that some curious bit
of timing no longer occurs and your driver just happens to be in memory just
long enough for whatever bit of dangling callback you have to complete
before the loader unmaps the image.

Use .reload /unl to load your symbols against the ?unloaded? location of
your driver, analyze the stack back trace very carefully looking at the
state of the system (and the locals on the stack) owned by the activation
frame in your driver. Figure out why execution is running through your
driver after it has unloaded.

Don?t call just yet until you prove that the driver
improperly cached a pointer to your code and tried to call your driver after
it unloaded for no good reason. Actually, you should be thankful that you
have a definitive way to cause the crash. It will make it easier to find
what is likely a bug in your driver.

So, do you have any, Timers, DPCs, Work Items, or Callbacks? Do you
reference count your ?module? to prevent DriverUnload() from completing
until all of these callback capable resources have been drained and
released?

Good Luck,

Dave Cattley

Consulting Engineer

Systems Software Development

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of SatheeshBabu
Muthupandi
Sent: Friday, February 13, 2009 7:09 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] BSOD with
DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver

Dave,

bnadimd5.sys is my driver which is under development. What I’m doing is thru
notify object DLL (took the one from sample MUL driver) installing my
Intermediate driver. I can see my driver entry gets called but after that it
immediately crashes.

Point here is, I won’t see the crash if there is no TrendMicro
Software(antivirus software) installed in the system. BSOD occurs only when
the TrendMicro Software is present.

Protocolbindadapter itself is not get called. BSOD occurs prior to that.

Any clue?

Regards
Satheesh

On Fri, Feb 13, 2009 at 3:38 PM, David R. Cattley wrote:

What driver is bnadimd5.sys? Yours?

Turn on driver verifier for your driver and NDIS.SYS. Turn it on for the
3rd party driver too.

The bugcheck is (as it says) a case where a module has been unloaded
(bnadimd5.sys) yet a callback occurred (or return through a call occurred)
in that driver.

The driver did not correctly synchronize its and allowed itself to be
unloaded when it was not safe to do so. The crash occurred after the
unload. Since you don’t say exactly all of what you were doing, it could
be that you had installed your IM driver and that it was being loaded /
unloaded / reloaded. It might be that the unload prior to the load is where
the real problem is.

Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Friday, February 13, 2009 6:01 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] BSOD with
DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver

Hi All,

When I tried to install my Intermediate driver, right after Driver Entry I’m
seeing BSOD. This happens only when there is a trend micro filter driver
(antivirus) software is enabled.
Below are the BSOD logs. Can anybody help me to debug this crash.

Use !analyze -v to get detailed debugging information.

BugCheck CE, {f4c72680, 8, f4c72680, 0}

Probably caused by : bnadimd5.sys ( bnadimd5+2680 )

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

nt!RtlpBreakWithStatusInstruction:
807584dc cc int 3
kd> !analyze -v
*******************************************************************



Bugcheck Analysis



*************************************************************************


DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS (ce)
A driver unloaded without cancelling timers, DPCs, worker threads, etc.
The broken driver’s name is displayed on the screen.
Arguments:
Arg1: f4c72680, memory referenced
Arg2: 00000008, value 0 = read operation, 1 = write operation
Arg3: f4c72680, If non-zero, the instruction address which referenced the
bad memory
address.
Arg4: 00000000, Mm internal code.

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

WRITE_ADDRESS: f4c72680

FAULTING_IP:
bnadimd5+2680
f4c72680 ?? ???

DEFAULT_BUCKET_ID: DRIVER_FAULT

BUGCHECK_STR: 0xCE

PROCESS_NAME: System

CURRENT_IRQL: 1

TRAP_FRAME: f5b2ab80 – (.trap 0xfffffffff5b2ab80)
ErrCode = 00000010
eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
edi=87418350
eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
efl=00010246
<unloaded_bnadimd5.sys>+0x2680:
f4c72680 ?? ???
Resetting default scope

IP_MODULE_UNLOADED:
bnadimd5+2680
f4c72680 ?? ???

LAST_CONTROL_TRANSFER: from 806377bf to 807584dc

STACK_TEXT:
f5b2a6f0 806377bf 00000003 00000000 00000000
nt!RtlpBreakWithStatusInstruction
f5b2a73c 80638743 00000003 c07a6390 00000000 nt!KiBugCheckDebugBreak+0x19
f5b2aad4 80638b7d 00000050 f4c72680 00000008 nt!KeBugCheck2+0x5e1
f5b2aaf4 8070f3b1 00000050 f4c72680 00000008 nt!KeBugCheckEx+0x1b
f5b2ab68 8077ad54 00000008 f4c72680 00000000 nt!MmAccessFault+0x1bd3
f5b2ab68 f4c72680 00000008 f4c72680 00000000 nt!KiTrap0E+0xe4
WARNING: Frame IP not in any known module. Following frames may be wrong.
f5b2abf0 f6f0a9d5 f5b2ac80 f5b2ac18 87838334 <unloaded_bnadimd5.sys>+0x2680
f5b2ac84 f6f0d073 87418350 8760d518 80bbf460
NDIS!ndisInitializeBinding+0x1a1
f5b2ad0c f6f15a03 87418350 87397008 87397098
NDIS!ndisCheckAdapterBindings+0xf5
f5b2ad94 f6f08df5 87397008 00000000 86d89020
NDIS!ndisCheckProtocolBindings+0x13d
f5b2adac 80a0041e 87397088 00000000 00000000 NDIS!ndisWorkerThread+0xdd
f5b2addc 8077cb86 f6f08d18 87397088 00000000 nt!PspSystemThreadStartup+0x2e
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16

STACK_COMMAND: kb

FOLLOWUP_IP:
bnadimd5+2680
f4c72680 ?? ???

SYMBOL_STACK_INDEX: 6

SYMBOL_NAME: bnadimd5+2680

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: bnadimd5

IMAGE_NAME: bnadimd5.sys

DEBUG_FLR_IMAGE_TIMESTAMP: 0

FAILURE_BUCKET_ID: 0xCE_W_bnadimd5+2680

BUCKET_ID: 0xCE_W_bnadimd5+2680

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

kd> .trap 0xfffffffff5b2ab80
ErrCode = 00000010
eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
edi=87418350
eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
efl=00010246
<unloaded_bnadimd5.sys>+0x2680:
f4c72680 ?? ???

thanks
satheesh


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


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

— 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</unloaded_bnadimd5.sys></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys>

Please post your code. The very first idea that gets into my head that you did something like creating a system thread and then failed DriverEntry() for some reason. As a result, your driver got unloaded while some references to its memory are still outstanding.

This is, probably, one of the easiest bugs to fix, because the reason for a crash is plainly obvious. I had seen DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS when I was programming Windows on numerous occasions, and it never took me more than 15 minutes to fix a bug of this type, although fixing some particularly nasty bug could take days and even weeks…

Anton Bassov

All,

While debugging, I found that my DriverEntry gets called twice…meaning
first time after DriverEntry returns success, nt!IopLoadDriver fails and
second time DriverEntry gets called.
When the nt!IopLoadDriver fails, all my entry points are freed (null) and
protocolbindadapter entry point is called (which is NULL) leads to crash.

I dont have any reference count for my driver instance. Also dont have any
DPC’s, timers, workitems etc…

thanks
satheesh

On Fri, Feb 13, 2009 at 8:52 PM, David R. Cattley wrote:

> Satheesh,
>
>
>
> Yes, I have a clue. Better, you provided evidence that the problem is
> with your driver. Windows has identified that your driver unloaded from
> memory while it was still possible (neah, actual) that a code execution path
> could occur through where your driver was previously loaded. This can only
> occur because your driver left behind:
>
>
>
> 1. A timer.
>
> 2. A DPC
>
> 3. A work item.
>
> 4. A callback registered with another driver.
>
> 5. Etc., etc.
>
>
>
> Now regardless of the vindication you might feel that it only happens
> because driver is loaded and when you remove driver it
> no longer happens, that is not nearly as strong a bit of evidence as the
> crash dump saying your (now unloaded) driver is in the code path.
>
>
>
> The driver is simply changing the test so that some curious bit
> of timing no longer occurs and your driver just happens to be in memory just
> long enough for whatever bit of dangling callback you have to complete
> before the loader unmaps the image.
>
>
>
> Use .reload /unl to load your symbols against the ‘unloaded’ location of
> your driver, analyze the stack back trace very carefully looking at the
> state of the system (and the locals on the stack) owned by the activation
> frame in your driver. Figure out why execution is running through your
> driver after it has unloaded.
>
>
>
> Don’t call just yet until you prove that the driver
> improperly cached a pointer to your code and tried to call your driver after
> it unloaded for no good reason. Actually, you should be thankful that you
> have a definitive way to cause the crash. It will make it easier to find
> what is likely a bug in your driver.
>
>
>
> So, do you have any, Timers, DPCs, Work Items, or Callbacks? Do you
> reference count your ‘module’ to prevent DriverUnload() from completing
> until all of these callback capable resources have been drained and
> released?
>
>
>
> Good Luck,
>
> Dave Cattley
>
> Consulting Engineer
>
> Systems Software Development
>
>
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *SatheeshBabu Muthupandi
> Sent: Friday, February 13, 2009 7:09 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] BSOD with
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver
>
>
>
> Dave,
>
> bnadimd5.sys is my driver which is under development. What I’m doing is
> thru notify object DLL (took the one from sample MUL driver) installing my
> Intermediate driver. I can see my driver entry gets called but after that it
> immediately crashes.
>
> Point here is, I won’t see the crash if there is no TrendMicro
> Software(antivirus software) installed in the system. BSOD occurs only when
> the TrendMicro Software is present.
>
> Protocolbindadapter itself is not get called. BSOD occurs prior to that.
>
> Any clue?
>
> Regards
> Satheesh
>
>
> On Fri, Feb 13, 2009 at 3:38 PM, David R. Cattley
> wrote:
>
> What driver is bnadimd5.sys? Yours?
>
> Turn on driver verifier for your driver and NDIS.SYS. Turn it on for
> the
> 3rd party driver too.
>
> The bugcheck is (as it says) a case where a module has been unloaded
> (bnadimd5.sys) yet a callback occurred (or return through a call occurred)
> in that driver.
>
> The driver did not correctly synchronize its and allowed itself to be
> unloaded when it was not safe to do so. The crash occurred after the
> unload. Since you don’t say exactly all of what you were doing, it could
> be that you had installed your IM driver and that it was being loaded /
> unloaded / reloaded. It might be that the unload prior to the load is
> where
> the real problem is.
>
> Good Luck,
> Dave Cattley
> Consulting Engineer
> Systems Software Development
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> xxxxx@gmail.com
> Sent: Friday, February 13, 2009 6:01 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] BSOD with
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver
>
> Hi All,
>
> When I tried to install my Intermediate driver, right after Driver Entry
> I’m
> seeing BSOD. This happens only when there is a trend micro filter driver
> (antivirus) software is enabled.
> Below are the BSOD logs. Can anybody help me to debug this crash.
>
>
> Use !analyze -v to get detailed debugging information.
>
> BugCheck CE, {f4c72680, 8, f4c72680, 0}
>
>
>
>
>
> Probably caused by : bnadimd5.sys ( bnadimd5+2680 )
>
> Followup: MachineOwner
> ---------
>
> nt!RtlpBreakWithStatusInstruction:
> 807584dc cc int 3
> kd> !analyze -v
>
> *************************************************************************
>

> *
> *
> * Bugcheck Analysis
> *
> *
> *
>
> *************************************************************************
>

>
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS (ce)
> A driver unloaded without cancelling timers, DPCs, worker threads, etc.
> The broken driver’s name is displayed on the screen.
> Arguments:
> Arg1: f4c72680, memory referenced
> Arg2: 00000008, value 0 = read operation, 1 = write operation
> Arg3: f4c72680, If non-zero, the instruction address which referenced the
> bad memory
> address.
> Arg4: 00000000, Mm internal code.
>
> Debugging Details:
> ------------------
>
>
>
>
>
>
> WRITE_ADDRESS: f4c72680
>
> FAULTING_IP:
> bnadimd5+2680
> f4c72680 ?? ???
>
> DEFAULT_BUCKET_ID: DRIVER_FAULT
>
> BUGCHECK_STR: 0xCE
>
> PROCESS_NAME: System
>
> CURRENT_IRQL: 1
>
> TRAP_FRAME: f5b2ab80 – (.trap 0xfffffffff5b2ab80)
> ErrCode = 00000010
> eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
> edi=87418350
> eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
> nc
> cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
> efl=00010246
> <unloaded_bnadimd5.sys>+0x2680:
> f4c72680 ?? ???
> Resetting default scope
>
> IP_MODULE_UNLOADED:
> bnadimd5+2680
> f4c72680 ?? ???
>
> LAST_CONTROL_TRANSFER: from 806377bf to 807584dc
>
> STACK_TEXT:
> f5b2a6f0 806377bf 00000003 00000000 00000000
> nt!RtlpBreakWithStatusInstruction
> f5b2a73c 80638743 00000003 c07a6390 00000000 nt!KiBugCheckDebugBreak+0x19
> f5b2aad4 80638b7d 00000050 f4c72680 00000008 nt!KeBugCheck2+0x5e1
> f5b2aaf4 8070f3b1 00000050 f4c72680 00000008 nt!KeBugCheckEx+0x1b
> f5b2ab68 8077ad54 00000008 f4c72680 00000000 nt!MmAccessFault+0x1bd3
> f5b2ab68 f4c72680 00000008 f4c72680 00000000 nt!KiTrap0E+0xe4
> WARNING: Frame IP not in any known module. Following frames may be wrong.
> f5b2abf0 f6f0a9d5 f5b2ac80 f5b2ac18 87838334 <unloaded_bnadimd5.sys>+0x2680
> f5b2ac84 f6f0d073 87418350 8760d518 80bbf460
> NDIS!ndisInitializeBinding+0x1a1
> f5b2ad0c f6f15a03 87418350 87397008 87397098
> NDIS!ndisCheckAdapterBindings+0xf5
> f5b2ad94 f6f08df5 87397008 00000000 86d89020
> NDIS!ndisCheckProtocolBindings+0x13d
> f5b2adac 80a0041e 87397088 00000000 00000000 NDIS!ndisWorkerThread+0xdd
> f5b2addc 8077cb86 f6f08d18 87397088 00000000 nt!PspSystemThreadStartup+0x2e
> 00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16
>
>
> STACK_COMMAND: kb
>
> FOLLOWUP_IP:
> bnadimd5+2680
> f4c72680 ?? ???
>
> SYMBOL_STACK_INDEX: 6
>
> SYMBOL_NAME: bnadimd5+2680
>
> FOLLOWUP_NAME: MachineOwner
>
> MODULE_NAME: bnadimd5
>
> IMAGE_NAME: bnadimd5.sys
>
> DEBUG_FLR_IMAGE_TIMESTAMP: 0
>
> FAILURE_BUCKET_ID: 0xCE_W_bnadimd5+2680
>
> BUCKET_ID: 0xCE_W_bnadimd5+2680
>
> Followup: MachineOwner
> ---------
>
> kd> .trap 0xfffffffff5b2ab80
> ErrCode = 00000010
> eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
> edi=87418350
> eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
> nc
> cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
> efl=00010246
> <unloaded_bnadimd5.sys>+0x2680:
> f4c72680 ?? ???
>
> thanks
> satheesh
>
>
> —
> 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
>
>
> —
> 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
>
>
> — 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
>
> —
> 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
></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys>

DriverEntry only gets called *once* per loading of your driver. So, your
driver is getting loaded, unloaded, and loaded again.

If you return STATUS_SUCCESS (or NDIS_STATUS_SUCCESS) from DriverEntry, and
have registered a MiniportUnload handler then be sure that you are cleaning
up your protocol registration properly.

Does your MiniportInitialize() get called for some number of (virtual)
miniports? Does your MiniportHalt() get called too?

Are you by chance running on Vista?

The bottom line is that your driver is leaving behind a ?callback?
potential. At this point I would guess that you are not removing the
Protocol Registration on unload and so the next time your driver is loaded
and NDIS triggers binding, it is binding to an ?old? protocol registration
pointing into space.

Good Luck,

Dave Cattley

Consulting Engineer

Systems Software Development

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of SatheeshBabu
Muthupandi
Sent: Monday, February 16, 2009 12:26 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] BSOD with
DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver

All,

While debugging, I found that my DriverEntry gets called twice…meaning
first time after DriverEntry returns success, nt!IopLoadDriver fails and
second time DriverEntry gets called.
When the nt!IopLoadDriver fails, all my entry points are freed (null) and
protocolbindadapter entry point is called (which is NULL) leads to crash.

I dont have any reference count for my driver instance. Also dont have any
DPC’s, timers, workitems etc…

thanks
satheesh

On Fri, Feb 13, 2009 at 8:52 PM, David R. Cattley wrote:

Satheesh,

Yes, I have a clue. Better, you provided evidence that the problem is
with your driver. Windows has identified that your driver unloaded from
memory while it was still possible (neah, actual) that a code execution path
could occur through where your driver was previously loaded. This can only
occur because your driver left behind:

1. A timer.

2. A DPC

3. A work item.

4. A callback registered with another driver.

5. Etc., etc.

Now regardless of the vindication you might feel that it only happens
because driver is loaded and when you remove driver it
no longer happens, that is not nearly as strong a bit of evidence as the
crash dump saying your (now unloaded) driver is in the code path.

The driver is simply changing the test so that some curious bit
of timing no longer occurs and your driver just happens to be in memory just
long enough for whatever bit of dangling callback you have to complete
before the loader unmaps the image.

Use .reload /unl to load your symbols against the ‘unloaded’ location of
your driver, analyze the stack back trace very carefully looking at the
state of the system (and the locals on the stack) owned by the activation
frame in your driver. Figure out why execution is running through your
driver after it has unloaded.

Don’t call just yet until you prove that the driver
improperly cached a pointer to your code and tried to call your driver after
it unloaded for no good reason. Actually, you should be thankful that you
have a definitive way to cause the crash. It will make it easier to find
what is likely a bug in your driver.

So, do you have any, Timers, DPCs, Work Items, or Callbacks? Do you
reference count your ‘module’ to prevent DriverUnload() from completing
until all of these callback capable resources have been drained and
released?

Good Luck,

Dave Cattley

Consulting Engineer

Systems Software Development

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of SatheeshBabu
Muthupandi
Sent: Friday, February 13, 2009 7:09 PM

To: Windows System Software Devs Interest List

Subject: Re: [ntdev] BSOD with
DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver

Dave,

bnadimd5.sys is my driver which is under development. What I’m doing is thru
notify object DLL (took the one from sample MUL driver) installing my
Intermediate driver. I can see my driver entry gets called but after that it
immediately crashes.

Point here is, I won’t see the crash if there is no TrendMicro
Software(antivirus software) installed in the system. BSOD occurs only when
the TrendMicro Software is present.

Protocolbindadapter itself is not get called. BSOD occurs prior to that.

Any clue?

Regards
Satheesh

On Fri, Feb 13, 2009 at 3:38 PM, David R. Cattley wrote:

What driver is bnadimd5.sys? Yours?

Turn on driver verifier for your driver and NDIS.SYS. Turn it on for the
3rd party driver too.

The bugcheck is (as it says) a case where a module has been unloaded
(bnadimd5.sys) yet a callback occurred (or return through a call occurred)
in that driver.

The driver did not correctly synchronize its and allowed itself to be
unloaded when it was not safe to do so. The crash occurred after the
unload. Since you don’t say exactly all of what you were doing, it could
be that you had installed your IM driver and that it was being loaded /
unloaded / reloaded. It might be that the unload prior to the load is where
the real problem is.

Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Friday, February 13, 2009 6:01 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] BSOD with
DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver

Hi All,

When I tried to install my Intermediate driver, right after Driver Entry I’m
seeing BSOD. This happens only when there is a trend micro filter driver
(antivirus) software is enabled.
Below are the BSOD logs. Can anybody help me to debug this crash.

Use !analyze -v to get detailed debugging information.

BugCheck CE, {f4c72680, 8, f4c72680, 0}

Probably caused by : bnadimd5.sys ( bnadimd5+2680 )

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

nt!RtlpBreakWithStatusInstruction:
807584dc cc int 3
kd> !analyze -v
*******************************************************************



Bugcheck Analysis



*************************************************************************


DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS (ce)
A driver unloaded without cancelling timers, DPCs, worker threads, etc.
The broken driver’s name is displayed on the screen.
Arguments:
Arg1: f4c72680, memory referenced
Arg2: 00000008, value 0 = read operation, 1 = write operation
Arg3: f4c72680, If non-zero, the instruction address which referenced the
bad memory
address.
Arg4: 00000000, Mm internal code.

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

WRITE_ADDRESS: f4c72680

FAULTING_IP:
bnadimd5+2680
f4c72680 ?? ???

DEFAULT_BUCKET_ID: DRIVER_FAULT

BUGCHECK_STR: 0xCE

PROCESS_NAME: System

CURRENT_IRQL: 1

TRAP_FRAME: f5b2ab80 – (.trap 0xfffffffff5b2ab80)
ErrCode = 00000010
eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
edi=87418350
eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
efl=00010246
<unloaded_bnadimd5.sys>+0x2680:
f4c72680 ?? ???
Resetting default scope

IP_MODULE_UNLOADED:
bnadimd5+2680
f4c72680 ?? ???

LAST_CONTROL_TRANSFER: from 806377bf to 807584dc

STACK_TEXT:
f5b2a6f0 806377bf 00000003 00000000 00000000
nt!RtlpBreakWithStatusInstruction
f5b2a73c 80638743 00000003 c07a6390 00000000 nt!KiBugCheckDebugBreak+0x19
f5b2aad4 80638b7d 00000050 f4c72680 00000008 nt!KeBugCheck2+0x5e1
f5b2aaf4 8070f3b1 00000050 f4c72680 00000008 nt!KeBugCheckEx+0x1b
f5b2ab68 8077ad54 00000008 f4c72680 00000000 nt!MmAccessFault+0x1bd3
f5b2ab68 f4c72680 00000008 f4c72680 00000000 nt!KiTrap0E+0xe4
WARNING: Frame IP not in any known module. Following frames may be wrong.
f5b2abf0 f6f0a9d5 f5b2ac80 f5b2ac18 87838334 <unloaded_bnadimd5.sys>+0x2680
f5b2ac84 f6f0d073 87418350 8760d518 80bbf460
NDIS!ndisInitializeBinding+0x1a1
f5b2ad0c f6f15a03 87418350 87397008 87397098
NDIS!ndisCheckAdapterBindings+0xf5
f5b2ad94 f6f08df5 87397008 00000000 86d89020
NDIS!ndisCheckProtocolBindings+0x13d
f5b2adac 80a0041e 87397088 00000000 00000000 NDIS!ndisWorkerThread+0xdd
f5b2addc 8077cb86 f6f08d18 87397088 00000000 nt!PspSystemThreadStartup+0x2e
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16

STACK_COMMAND: kb

FOLLOWUP_IP:
bnadimd5+2680
f4c72680 ?? ???

SYMBOL_STACK_INDEX: 6

SYMBOL_NAME: bnadimd5+2680

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: bnadimd5

IMAGE_NAME: bnadimd5.sys

DEBUG_FLR_IMAGE_TIMESTAMP: 0

FAILURE_BUCKET_ID: 0xCE_W_bnadimd5+2680

BUCKET_ID: 0xCE_W_bnadimd5+2680

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

kd> .trap 0xfffffffff5b2ab80
ErrCode = 00000010
eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
edi=87418350
eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
efl=00010246
<unloaded_bnadimd5.sys>+0x2680:
f4c72680 ?? ???

thanks
satheesh


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


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

— 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


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

— 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</unloaded_bnadimd5.sys></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys>

David,

Thanks for your reply.

FYI, I’m installing my driver on fresh OS(Windows 2003 server SP2). My
miniportinitialize is not at all getting called. MiniportInitialize gets
called in the context of ProtocolBindAdapter. In my scenario
protocolbinadapter itself is not called.
I’m returning NDIS_STATUS_SUCCESS from my DriverEntry if my registration of
miniport and protocol characteristics happens success.

What could be the reason for the driver to get unloaded before loading the
driver properly.
Though registration happens properly, why nt!IoPLoadDriver fails in loading
the driver and comes for DriverEntry call, second time…

Am I doing any mistake in callback registration of miniport or protocol?

regards
satheesh

On Mon, Feb 16, 2009 at 11:57 AM, David R. Cattley wrote:

> DriverEntry only gets called once per loading of your driver. So,
> your driver is getting loaded, unloaded, and loaded again.
>
>
>
> If you return STATUS_SUCCESS (or NDIS_STATUS_SUCCESS) from DriverEntry, and
> have registered a MiniportUnload handler then be sure that you are cleaning
> up your protocol registration properly.
>
>
>
> Does your MiniportInitialize() get called for some number of (virtual)
> miniports? Does your MiniportHalt() get called too?
>
>
>
> Are you by chance running on Vista?
>
>
>
> The bottom line is that your driver is leaving behind a ‘callback’
> potential. At this point I would guess that you are not removing the
> Protocol Registration on unload and so the next time your driver is loaded
> and NDIS triggers binding, it is binding to an ‘old’ protocol registration
> pointing into space.
>
>
>
> Good Luck,
>
> Dave Cattley
>
> Consulting Engineer
>
> Systems Software Development
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *SatheeshBabu Muthupandi
> Sent: Monday, February 16, 2009 12:26 PM
>
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] BSOD with
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver
>
>
>
> All,
>
> While debugging, I found that my DriverEntry gets called twice…meaning
> first time after DriverEntry returns success, nt!IopLoadDriver fails and
> second time DriverEntry gets called.
> When the nt!IopLoadDriver fails, all my entry points are freed (null) and
> protocolbindadapter entry point is called (which is NULL) leads to crash.
>
> I dont have any reference count for my driver instance. Also dont have any
> DPC’s, timers, workitems etc…
>
>
> thanks
> satheesh
>
> On Fri, Feb 13, 2009 at 8:52 PM, David R. Cattley
> wrote:
>
> Satheesh,
>
>
>
> Yes, I have a clue. Better, you provided evidence that the problem is
> with your driver. Windows has identified that your driver unloaded from
> memory while it was still possible (neah, actual) that a code execution path
> could occur through where your driver was previously loaded. This can only
> occur because your driver left behind:
>
>
>
> 1. A timer.
>
> 2. A DPC
>
> 3. A work item.
>
> 4. A callback registered with another driver.
>
> 5. Etc., etc.
>
>
>
> Now regardless of the vindication you might feel that it only happens
> because driver is loaded and when you remove driver it
> no longer happens, that is not nearly as strong a bit of evidence as the
> crash dump saying your (now unloaded) driver is in the code path.
>
>
>
> The driver is simply changing the test so that some curious bit
> of timing no longer occurs and your driver just happens to be in memory just
> long enough for whatever bit of dangling callback you have to complete
> before the loader unmaps the image.
>
>
>
> Use .reload /unl to load your symbols against the ‘unloaded’ location of
> your driver, analyze the stack back trace very carefully looking at the
> state of the system (and the locals on the stack) owned by the activation
> frame in your driver. Figure out why execution is running through your
> driver after it has unloaded.
>
>
>
> Don’t call just yet until you prove that the driver
> improperly cached a pointer to your code and tried to call your driver after
> it unloaded for no good reason. Actually, you should be thankful that you
> have a definitive way to cause the crash. It will make it easier to find
> what is likely a bug in your driver.
>
>
>
> So, do you have any, Timers, DPCs, Work Items, or Callbacks? Do you
> reference count your ‘module’ to prevent DriverUnload() from completing
> until all of these callback capable resources have been drained and
> released?
>
>
>
> Good Luck,
>
> Dave Cattley
>
> Consulting Engineer
>
> Systems Software Development
>
>
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *SatheeshBabu Muthupandi
> Sent: Friday, February 13, 2009 7:09 PM
>
>
> To: Windows System Software Devs Interest List
>
> Subject: Re: [ntdev] BSOD with
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver
>
>
>
> Dave,
>
> bnadimd5.sys is my driver which is under development. What I’m doing is
> thru notify object DLL (took the one from sample MUL driver) installing my
> Intermediate driver. I can see my driver entry gets called but after that it
> immediately crashes.
>
> Point here is, I won’t see the crash if there is no TrendMicro
> Software(antivirus software) installed in the system. BSOD occurs only when
> the TrendMicro Software is present.
>
> Protocolbindadapter itself is not get called. BSOD occurs prior to that.
>
> Any clue?
>
> Regards
> Satheesh
>
> On Fri, Feb 13, 2009 at 3:38 PM, David R. Cattley
> wrote:
>
> What driver is bnadimd5.sys? Yours?
>
> Turn on driver verifier for your driver and NDIS.SYS. Turn it on for
> the
> 3rd party driver too.
>
> The bugcheck is (as it says) a case where a module has been unloaded
> (bnadimd5.sys) yet a callback occurred (or return through a call occurred)
> in that driver.
>
> The driver did not correctly synchronize its and allowed itself to be
> unloaded when it was not safe to do so. The crash occurred after the
> unload. Since you don’t say exactly all of what you were doing, it could
> be that you had installed your IM driver and that it was being loaded /
> unloaded / reloaded. It might be that the unload prior to the load is
> where
> the real problem is.
>
> Good Luck,
> Dave Cattley
> Consulting Engineer
> Systems Software Development
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> xxxxx@gmail.com
> Sent: Friday, February 13, 2009 6:01 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] BSOD with
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver
>
> Hi All,
>
> When I tried to install my Intermediate driver, right after Driver Entry
> I’m
> seeing BSOD. This happens only when there is a trend micro filter driver
> (antivirus) software is enabled.
> Below are the BSOD logs. Can anybody help me to debug this crash.
>
>
> Use !analyze -v to get detailed debugging information.
>
> BugCheck CE, {f4c72680, 8, f4c72680, 0}
>
>
>
>
>
> Probably caused by : bnadimd5.sys ( bnadimd5+2680 )
>
> Followup: MachineOwner
> ---------
>
> nt!RtlpBreakWithStatusInstruction:
> 807584dc cc int 3
> kd> !analyze -v
>
> *************************************************************************
>

> *
> *
> * Bugcheck Analysis
> *
> *
> *
>
> *************************************************************************
>

>
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS (ce)
> A driver unloaded without cancelling timers, DPCs, worker threads, etc.
> The broken driver’s name is displayed on the screen.
> Arguments:
> Arg1: f4c72680, memory referenced
> Arg2: 00000008, value 0 = read operation, 1 = write operation
> Arg3: f4c72680, If non-zero, the instruction address which referenced the
> bad memory
> address.
> Arg4: 00000000, Mm internal code.
>
> Debugging Details:
> ------------------
>
>
>
>
>
>
> WRITE_ADDRESS: f4c72680
>
> FAULTING_IP:
> bnadimd5+2680
> f4c72680 ?? ???
>
> DEFAULT_BUCKET_ID: DRIVER_FAULT
>
> BUGCHECK_STR: 0xCE
>
> PROCESS_NAME: System
>
> CURRENT_IRQL: 1
>
> TRAP_FRAME: f5b2ab80 – (.trap 0xfffffffff5b2ab80)
> ErrCode = 00000010
> eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
> edi=87418350
> eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
> nc
> cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
> efl=00010246
> <unloaded_bnadimd5.sys>+0x2680:
> f4c72680 ?? ???
> Resetting default scope
>
> IP_MODULE_UNLOADED:
> bnadimd5+2680
> f4c72680 ?? ???
>
> LAST_CONTROL_TRANSFER: from 806377bf to 807584dc
>
> STACK_TEXT:
> f5b2a6f0 806377bf 00000003 00000000 00000000
> nt!RtlpBreakWithStatusInstruction
> f5b2a73c 80638743 00000003 c07a6390 00000000 nt!KiBugCheckDebugBreak+0x19
> f5b2aad4 80638b7d 00000050 f4c72680 00000008 nt!KeBugCheck2+0x5e1
> f5b2aaf4 8070f3b1 00000050 f4c72680 00000008 nt!KeBugCheckEx+0x1b
> f5b2ab68 8077ad54 00000008 f4c72680 00000000 nt!MmAccessFault+0x1bd3
> f5b2ab68 f4c72680 00000008 f4c72680 00000000 nt!KiTrap0E+0xe4
> WARNING: Frame IP not in any known module. Following frames may be wrong.
> f5b2abf0 f6f0a9d5 f5b2ac80 f5b2ac18 87838334 <unloaded_bnadimd5.sys>+0x2680
> f5b2ac84 f6f0d073 87418350 8760d518 80bbf460
> NDIS!ndisInitializeBinding+0x1a1
> f5b2ad0c f6f15a03 87418350 87397008 87397098
> NDIS!ndisCheckAdapterBindings+0xf5
> f5b2ad94 f6f08df5 87397008 00000000 86d89020
> NDIS!ndisCheckProtocolBindings+0x13d
> f5b2adac 80a0041e 87397088 00000000 00000000 NDIS!ndisWorkerThread+0xdd
> f5b2addc 8077cb86 f6f08d18 87397088 00000000 nt!PspSystemThreadStartup+0x2e
> 00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16
>
>
> STACK_COMMAND: kb
>
> FOLLOWUP_IP:
> bnadimd5+2680
> f4c72680 ?? ???
>
> SYMBOL_STACK_INDEX: 6
>
> SYMBOL_NAME: bnadimd5+2680
>
> FOLLOWUP_NAME: MachineOwner
>
> MODULE_NAME: bnadimd5
>
> IMAGE_NAME: bnadimd5.sys
>
> DEBUG_FLR_IMAGE_TIMESTAMP: 0
>
> FAILURE_BUCKET_ID: 0xCE_W_bnadimd5+2680
>
> BUCKET_ID: 0xCE_W_bnadimd5+2680
>
> Followup: MachineOwner
> ---------
>
> kd> .trap 0xfffffffff5b2ab80
> ErrCode = 00000010
> eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
> edi=87418350
> eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
> nc
> cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
> efl=00010246
> <unloaded_bnadimd5.sys>+0x2680:
> f4c72680 ?? ???
>
> thanks
> satheesh
>
>
> —
> 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
>
>
> —
> 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
>
>
> — 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
>
>
> —
> 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
>
>
> — 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
>
> —
> 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
></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys>

> I’m returning NDIS_STATUS_SUCCESS from my DriverEntry if my registration of

miniport and protocol characteristics happens success.

And if not??? For example, if you fail to register a protocol edge for this or that reason, and, hence, fail DriverEntry(), are you sure you deregister miniport one??? As both Dave and me told you already, you get this BSOD because you fail DriverEntry() but some outstanding references to your module are still there. As a result, someone calls your driver after it had already been unloaded.BANG!!!..

As I told you already, show us your code, and I think we will be able to detect an error pretty shortly…

Anton Bassov


What could be the reason for the driver to get unloaded before loading the
driver properly.

The most likely reason is that you are not returning STATUS_SUCCESS from
DriverEntry. I would bet you $1 that was the root issue here but doing so
violates the list rules about discussing rates ?

But seriously, do you have a debugger? Have you stepped through your
DriverEntry? Do you have the very simplest of diagnostics possible in a
DriverEntry?

NTSTATUS
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
)
{
NTSTAUS ntStatus;

DbgPrint(“MyDrv!++DriverEntry(%p,%p)\n”, DriverObject,
RegistryPath);

// Somewhere, you better be setting ntStatus to a return value…

ASSERT(NT_SUCCESS(ntStatus));
DbgPrint(“MyDrv!–DriverEntry(%p,%p)->%#x\n”, DriverObject,
RegistryPath, ntStatus);
return ntStatus;
}

What you keep saying is that DriverEntry() returns STATUS_SUCCESS and that
for some unknown reason your driver is getting unloaded. Look, that is not
likely and that has been pointed out to you. You have not added any detail
to this discussion which would lead me to believe you really know the return
value of DriverEntry() because you have not done the simplest of thing -
post a debug trace showing a DbgPrint() on DriverEntry() ‘entry’ and ‘exit’
that spews out the result or any other substantive evidence.

So stop asking the same question with no further information. How do you
expect *us* to know what is going on in *your* driver unless you help.

Do a little debugging. It will seriously help your cause.

Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of SatheeshBabu
Muthupandi
Sent: Monday, February 16, 2009 3:45 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] BSOD with
DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver

David,

Thanks for your reply.

FYI, I’m installing my driver on fresh OS(Windows 2003 server SP2). My
miniportinitialize is not at all getting called. MiniportInitialize gets
called in the context of ProtocolBindAdapter. In my scenario
protocolbinadapter itself is not called.
I’m returning NDIS_STATUS_SUCCESS from my DriverEntry if my registration of
miniport and protocol characteristics happens success.

What could be the reason for the driver to get unloaded before loading the
driver properly.
Though registration happens properly, why nt!IoPLoadDriver fails in loading
the driver and comes for DriverEntry call, second time…

Am I doing any mistake in callback registration of miniport or protocol?

regards
satheesh

On Mon, Feb 16, 2009 at 11:57 AM, David R. Cattley wrote:
DriverEntry only gets called once per loading of your driver.? So, your
driver is getting loaded, unloaded, and loaded again.
?
If you return STATUS_SUCCESS (or NDIS_STATUS_SUCCESS) from DriverEntry, and
have registered a MiniportUnload handler then be sure that you are cleaning
up your protocol registration properly.
?
Does your MiniportInitialize() get called for some number of (virtual)
miniports?? Does your MiniportHalt() get called too?
?
Are you by chance running on Vista?
?
The bottom line is that your driver is leaving behind a ‘callback’
potential.? At this point I would guess that you are not removing the
Protocol Registration on unload and so the next time your driver is loaded
and NDIS triggers binding, it is binding to an ‘old’ protocol registration
pointing into space.
?
Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development
?
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of SatheeshBabu
Muthupandi
Sent: Monday, February 16, 2009 12:26 PM

To: Windows System Software Devs Interest List
Subject: Re: [ntdev] BSOD with
DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver
?
All,

While debugging, I found that my DriverEntry gets called twice…meaning
first time after DriverEntry returns success, nt!IopLoadDriver fails and
second time DriverEntry gets called.
When the nt!IopLoadDriver fails, all my entry points are freed (null) and
protocolbindadapter entry point is called (which is NULL) leads to crash.

I dont have any reference count for my driver instance. Also dont have any
DPC’s, timers, workitems etc…

thanks
satheesh
On Fri, Feb 13, 2009 at 8:52 PM, David R. Cattley wrote:
Satheesh,
?
Yes, I have a clue.? Better, you provided evidence that the problem is
with your driver.? Windows has identified that your driver unloaded from
memory while it was still possible (neah, actual) that a code execution path
could occur through where your driver was previously loaded.? This can only
occur because your driver left behind:
?
1.??? ?A timer.
2.??? A DPC
3.??? A work item.
4.??? A callback registered with another driver.
5.??? Etc., etc.
?
Now regardless of the vindication you might feel that it only happens
because driver is loaded and when you remove driver it
no longer happens, that is not nearly as strong a bit of evidence as the
crash dump saying your (now unloaded) driver is in the code path.
?
The driver is simply changing the test so that some curious bit
of timing no longer occurs and your driver just happens to be in memory just
long enough for whatever bit of dangling callback you have to complete
before the loader unmaps the image.
?
Use .reload /unl to load your symbols against the ‘unloaded’ location of
your driver, analyze the stack back trace very carefully looking at the
state of the system (and the locals on the stack) owned by the activation
frame in your driver.? Figure out why execution is running through your
driver after it has unloaded.
?
Don’t call just yet until you prove that the driver
improperly cached a pointer to your code and tried to call your driver after
it unloaded for no good reason. ???Actually, you should be thankful that you
have a definitive way to cause the crash.? It will make it easier to find
what is likely a bug in your driver.
?
So, do you have any, Timers, DPCs, Work Items, or Callbacks??? Do you
reference count your ‘module’ to prevent DriverUnload() from completing
until all of these callback capable resources have been drained and
released?
?
Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development
?
?
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of SatheeshBabu
Muthupandi
Sent: Friday, February 13, 2009 7:09 PM

To: Windows System Software Devs Interest List
Subject: Re: [ntdev] BSOD with
DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver
?
Dave,

bnadimd5.sys is my driver which is under development. What I’m doing is thru
notify object DLL (took the one from sample MUL driver) installing my
Intermediate driver. I can see my driver entry gets called but after that it
immediately crashes.

Point here is, I won’t see the crash if there is no TrendMicro
Software(antivirus software) installed in the system. BSOD occurs only when
the TrendMicro Software is present.

Protocolbindadapter itself is not get called. BSOD occurs prior to that.

Any clue?

Regards
Satheesh
On Fri, Feb 13, 2009 at 3:38 PM, David R. Cattley wrote:
What driver is bnadimd5.sys? ?Yours?

Turn on driver verifier for your driver and NDIS.SYS. ? Turn it on for the
3rd party driver too.

The bugcheck is (as it says) a case where a module has been unloaded
(bnadimd5.sys) yet a callback occurred (or return through a call occurred)
in that driver.

The driver did not correctly synchronize its and allowed itself to be
unloaded when it was not safe to do so. ?The crash occurred after the
unload. ? Since you don’t say exactly all of what you were doing, it could
be that you had installed your IM driver and that it was being loaded /
unloaded / reloaded. ?It might be that the unload prior to the load is where
the real problem is.

Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Friday, February 13, 2009 6:01 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] BSOD with
DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver

Hi All,

When I tried to install my Intermediate driver, right after Driver Entry I’m
seeing BSOD. This happens only when there is a trend micro filter driver
(antivirus) software is enabled.
Below are the BSOD logs. Can anybody help me to debug this crash.

Use !analyze -v to get detailed debugging information.

BugCheck CE, {f4c72680, 8, f4c72680, 0}

Probably caused by : bnadimd5.sys ( bnadimd5+2680 )

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

nt!RtlpBreakWithStatusInstruction:
807584dc cc ? ? ? ? ? ? ?int ? ? 3
kd> !analyze -v
*******************************************************************



? ? ? ? ? ? ? ? ? ? ? ?Bugcheck Analysis



*************************************************************************


DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS (ce)
A driver unloaded without cancelling timers, DPCs, worker threads, etc.
The broken driver’s name is displayed on the screen.
Arguments:
Arg1: f4c72680, memory referenced
Arg2: 00000008, value 0 = read operation, 1 = write operation
Arg3: f4c72680, If non-zero, the instruction address which referenced the
bad memory
? ? ? ?address.
Arg4: 00000000, Mm internal code.

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

WRITE_ADDRESS: ?f4c72680

FAULTING_IP:
bnadimd5+2680
f4c72680 ?? ? ? ? ? ? ? ???

DEFAULT_BUCKET_ID: ?DRIVER_FAULT

BUGCHECK_STR: ?0xCE

PROCESS_NAME: ?System

CURRENT_IRQL: ?1

TRAP_FRAME: ?f5b2ab80 – (.trap 0xfffffffff5b2ab80)
ErrCode = 00000010
eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
edi=87418350
eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 ? ? ? ? nv up ei pl zr na pe
nc
cs=0008 ?ss=0010 ?ds=0023 ?es=0023 ?fs=0030 ?gs=0000
efl=00010246
<unloaded_bnadimd5.sys>+0x2680:
f4c72680 ?? ? ? ? ? ? ? ???
Resetting default scope

IP_MODULE_UNLOADED:
bnadimd5+2680
f4c72680 ?? ? ? ? ? ? ? ???

LAST_CONTROL_TRANSFER: ?from 806377bf to 807584dc

STACK_TEXT:
f5b2a6f0 806377bf 00000003 00000000 00000000
nt!RtlpBreakWithStatusInstruction
f5b2a73c 80638743 00000003 c07a6390 00000000 nt!KiBugCheckDebugBreak+0x19
f5b2aad4 80638b7d 00000050 f4c72680 00000008 nt!KeBugCheck2+0x5e1
f5b2aaf4 8070f3b1 00000050 f4c72680 00000008 nt!KeBugCheckEx+0x1b
f5b2ab68 8077ad54 00000008 f4c72680 00000000 nt!MmAccessFault+0x1bd3
f5b2ab68 f4c72680 00000008 f4c72680 00000000 nt!KiTrap0E+0xe4
WARNING: Frame IP not in any known module. Following frames may be wrong.
f5b2abf0 f6f0a9d5 f5b2ac80 f5b2ac18 87838334 <unloaded_bnadimd5.sys>+0x2680
f5b2ac84 f6f0d073 87418350 8760d518 80bbf460
NDIS!ndisInitializeBinding+0x1a1
f5b2ad0c f6f15a03 87418350 87397008 87397098
NDIS!ndisCheckAdapterBindings+0xf5
f5b2ad94 f6f08df5 87397008 00000000 86d89020
NDIS!ndisCheckProtocolBindings+0x13d
f5b2adac 80a0041e 87397088 00000000 00000000 NDIS!ndisWorkerThread+0xdd
f5b2addc 8077cb86 f6f08d18 87397088 00000000 nt!PspSystemThreadStartup+0x2e
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16

STACK_COMMAND: ?kb

FOLLOWUP_IP:
bnadimd5+2680
f4c72680 ?? ? ? ? ? ? ? ???

SYMBOL_STACK_INDEX: ?6

SYMBOL_NAME: ?bnadimd5+2680

FOLLOWUP_NAME: ?MachineOwner

MODULE_NAME: bnadimd5

IMAGE_NAME: ?bnadimd5.sys

DEBUG_FLR_IMAGE_TIMESTAMP: ?0

FAILURE_BUCKET_ID: ?0xCE_W_bnadimd5+2680

BUCKET_ID: ?0xCE_W_bnadimd5+2680

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

kd> .trap 0xfffffffff5b2ab80
ErrCode = 00000010
eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
edi=87418350
eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 ? ? ? ? nv up ei pl zr na pe
nc
cs=0008 ?ss=0010 ?ds=0023 ?es=0023 ?fs=0030 ?gs=0000
efl=00010246
<unloaded_bnadimd5.sys>+0x2680:
f4c72680 ?? ? ? ? ? ? ? ???

thanks
satheesh


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


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

— 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


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

— 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


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

— 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</unloaded_bnadimd5.sys></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys>

David,

Thanks for your reply. Sorry for not making it clear.
I took the logs and pasted here.By looking at the log, it says that *
*STATUS_PLUGPLAY_NO_DEVICE* (*c000025e)* *after DriverEntry which returned
success.
Because of the above error, system tries to load the driver second time by
calling* *DriverEntry.

Second time DriverEntry tries to load and same failure occurs but referring
to the first time registered entry points at **bnadimd5+2680 **(which is
*protocolbindadapter, found by memory watch*) which is NULL and leads to
BSOD.

FYI,

  • I’m trying this on Windows 2003 server with Service Pack2 Checked
    build.
  • Basically this driver is for adding Multi VLAN feature for our NIC
    driver.
  • my notify object DLL is the sample mux dll with slight modifications
    w.r.to. my driver

Please let me know what else I can add so that you (someone) help me on this
issue.

Once again sorry if i’m not making clear this time too.
*DriverEntry() ==>
BNAD_IMLAG Protocol Driver::Feb 17 2009::10:03:07 *
Break instruction exception - code 80000003 (first chance)
bnadimd5!DriverEntry+0x2a:
f4ed8c7a cc int 3
kd> p
bnadimd5!DriverEntry+0x2b:
f4ed8c7b 6860020000 push 260h
kd> p
bnadimd5!DriverEntry+0x3f:
f4ed8c8f 8b4508 mov eax,dword ptr [ebp+8]
kd> p
bnadimd5!DriverEntry+0x47:
f4ed8c97 8b4d0c mov ecx,dword ptr [ebp+0Ch]
kd> p
bnadimd5!DriverEntry+0x50:
f4ed8ca0 6a00 push 0
kd> p
bnadimd5!DriverEntry+0x65:
f4ed8cb5 e8e6c6ffff call bnadimd5!im_register_mport_chars (f4ed53a0)
kd> p
*im_register_mport_chars() ==>
<== im_register_mport_chars()*
bnadimd5!DriverEntry+0x6d:
f4ed8cbd 837dfc00 cmp dword ptr [ebp-4],0
kd> p
bnadimd5!DriverEntry+0xa0:
f4ed8cf0 e89bd8ffff call bnadimd5!im_register_protocol_chars
(f4ed6590)
kd> p
*im_register_protocol_chars() ==>
<== im_register_protocol_chars() with status= 0x0*
bnadimd5!DriverEntry+0xa8:
f4ed8cf8 837dfc00 cmp dword ptr [ebp-4],0
kd> p
bnadimd5!DriverEntry+0xcb:
f4ed8d1b 8b0d2042eef4 mov ecx,dword ptr [bnadimd5!global_driver_ctxt
(f4ee4220)]
kd> p
bnadimd5!DriverEntry+0xdf:
f4ed8d2f 685844eef4 push offset bnadimd5!global_driver_ctxt+0x238
(f4ee4458)
kd> p
bnadimd5!DriverEntry+0xe9:
f4ed8d39 686c44eef4 push offset bnadimd5!global_driver_ctxt+0x24c
(f4ee446c)
kd> p
bnadimd5!DriverEntry+0xf3:
f4ed8d43 684042eef4 push offset bnadimd5!global_driver_ctxt+0x20
(f4ee4240)
kd> p
bnadimd5!DriverEntry+0xfd:
f4ed8d4d 684842eef4 push offset bnadimd5!global_driver_ctxt+0x28
(f4ee4248)
kd> p
bnadimd5!DriverEntry+0x108:
f4ed8d58 687444eef4 push offset bnadimd5!global_driver_ctxt+0x254
(f4ee4474)
kd> p
bnadimd5!DriverEntry+0x112:
f4ed8d62 c7056444eef400000000 mov dword ptr
[bnadimd5!global_driver_ctxt+0x244 (f4ee4464)],0
kd> p
bnadimd5!DriverEntry+0x126:
f4ed8d76 33c0 xor eax,eax
kd> p
bnadimd5!DriverEntry+0x12e:
f4ed8d7e 837dfc00 cmp dword ptr [ebp-4],0
kd> p
bnadimd5!DriverEntry+0x156:
f4ed8da6 8b55fc mov edx,dword ptr [ebp-4]
kd> p
*<== DriverEntry() with status(0x0)*
bnadimd5!DriverEntry+0x167:
f4ed8db7 8b45fc mov eax,dword ptr [ebp-4]
kd> p
bnadimd5!DriverEntry+0x16a:
f4ed8dba 8be5 mov esp,ebp
kd> p
nt!IopLoadDriver+0x6e6:
809510e2 8bf8 mov edi,eax
kd> p
nt!IopLoadDriver+0x6e8:
809510e4 3bfb cmp edi,ebx
kd> g
Breakpoint 7 hit
nt!IopLoadDriver+0x72d:
80951129 7632 jbe nt!IopLoadDriver+0x761 (8095115d)
kd> p
nt!IopLoadDriver+0x761:
8095115d 895da0 mov dword ptr [ebp-60h],ebx
kd> p
nt!IopLoadDriver+0x764:
80951160 8b45a0 mov eax,dword ptr [ebp-60h]
kd> p
nt!IopLoadDriver+0x767:
80951163 395c8638 cmp dword ptr [esi+eax*4+38h],ebx
kd> p
nt!IopLoadDriver+0x76b:
80951167 7520 jne nt!IopLoadDriver+0x78d (80951189)
kd> p
nt!IopLoadDriver+0x78d:
80951189 ff45a0 inc dword ptr [ebp-60h]
kd> p
nt!IopLoadDriver+0x790:
8095118c 837da01b cmp dword ptr [ebp-60h],1Bh
kd> p
nt!IopLoadDriver+0x794:
80951190 76ce jbe nt!IopLoadDriver+0x764 (80951160)
kd> g
**PipCallDriverAddDevice: Unable to reference driver
\Driver\BNADIMM (c000025e)**
*DriverEntry() ==>
BNAD_IMLAG Protocol Driver::Feb 17 2009::10:03:07 *
Break instruction exception - code 80000003 (first chance)
bnadimd5!DriverEntry+0x2a:

thanks
satheesh

On Mon, Feb 16, 2009 at 8:35 PM, David R. Cattley wrote:

>
> What could be the reason for the driver to get unloaded before loading the
> driver properly.
>
>
> The most likely reason is that you are not returning STATUS_SUCCESS from
> DriverEntry. I would bet you $1 that was the root issue here but doing so
> violates the list rules about discussing rates ?
>
> But seriously, do you have a debugger? Have you stepped through your
> DriverEntry? Do you have the very simplest of diagnostics possible in a
> DriverEntry?
>
>
> NTSTATUS
> DriverEntry(
> IN PDRIVER_OBJECT DriverObject,
> IN PUNICODE_STRING RegistryPath
> )
> {
> NTSTAUS ntStatus;
>
> DbgPrint(“MyDrv!++DriverEntry(%p,%p)\n”, DriverObject,
> RegistryPath);
>
> // Somewhere, you better be setting ntStatus to a return value…
>
> ASSERT(NT_SUCCESS(ntStatus));
> DbgPrint(“MyDrv!–DriverEntry(%p,%p)->%#x\n”, DriverObject,
> RegistryPath, ntStatus);
> return ntStatus;
> }
>
>
> What you keep saying is that DriverEntry() returns STATUS_SUCCESS and that
> for some unknown reason your driver is getting unloaded. Look, that is not
> likely and that has been pointed out to you. You have not added any detail
> to this discussion which would lead me to believe you really know the
> return
> value of DriverEntry() because you have not done the simplest of thing -
> post a debug trace showing a DbgPrint() on DriverEntry() ‘entry’ and ‘exit’
> that spews out the result or any other substantive evidence.
>
> So stop asking the same question with no further information. How do you
> expect us to know what is going on in your driver unless you help.
>
> Do a little debugging. It will seriously help your cause.
>
> Good Luck,
> Dave Cattley
> Consulting Engineer
> Systems Software Development
>
>
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of SatheeshBabu
> Muthupandi
> Sent: Monday, February 16, 2009 3:45 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] BSOD with
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver
>
> David,
>
> Thanks for your reply.
>
> FYI, I’m installing my driver on fresh OS(Windows 2003 server SP2). My
> miniportinitialize is not at all getting called. MiniportInitialize gets
> called in the context of ProtocolBindAdapter. In my scenario
> protocolbinadapter itself is not called.
> I’m returning NDIS_STATUS_SUCCESS from my DriverEntry if my registration of
> miniport and protocol characteristics happens success.
>
> What could be the reason for the driver to get unloaded before loading the
> driver properly.
> Though registration happens properly, why nt!IoPLoadDriver fails in loading
> the driver and comes for DriverEntry call, second time…
>
> Am I doing any mistake in callback registration of miniport or protocol?
>
>
> regards
> satheesh
>
> On Mon, Feb 16, 2009 at 11:57 AM, David R. Cattley
> wrote:
> DriverEntry only gets called once per loading of your driver. So, your
> driver is getting loaded, unloaded, and loaded again.
>
> If you return STATUS_SUCCESS (or NDIS_STATUS_SUCCESS) from DriverEntry, and
> have registered a MiniportUnload handler then be sure that you are cleaning
> up your protocol registration properly.
>
> Does your MiniportInitialize() get called for some number of (virtual)
> miniports? Does your MiniportHalt() get called too?
>
> Are you by chance running on Vista?
>
> The bottom line is that your driver is leaving behind a ‘callback’
> potential. At this point I would guess that you are not removing the
> Protocol Registration on unload and so the next time your driver is loaded
> and NDIS triggers binding, it is binding to an ‘old’ protocol registration
> pointing into space.
>
> Good Luck,
> Dave Cattley
> Consulting Engineer
> Systems Software Development
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of SatheeshBabu
> Muthupandi
> Sent: Monday, February 16, 2009 12:26 PM
>
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] BSOD with
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver
>
> All,
>
> While debugging, I found that my DriverEntry gets called twice…meaning
> first time after DriverEntry returns success, nt!IopLoadDriver fails and
> second time DriverEntry gets called.
> When the nt!IopLoadDriver fails, all my entry points are freed (null) and
> protocolbindadapter entry point is called (which is NULL) leads to crash.
>
> I dont have any reference count for my driver instance. Also dont have any
> DPC’s, timers, workitems etc…
>
>
> thanks
> satheesh
> On Fri, Feb 13, 2009 at 8:52 PM, David R. Cattley
> wrote:
> Satheesh,
>
> Yes, I have a clue. Better, you provided evidence that the problem is
> with your driver. Windows has identified that your driver unloaded from
> memory while it was still possible (neah, actual) that a code execution
> path
> could occur through where your driver was previously loaded. This can only
> occur because your driver left behind:
>
> 1. A timer.
> 2. A DPC
> 3. A work item.
> 4. A callback registered with another driver.
> 5. Etc., etc.
>
> Now regardless of the vindication you might feel that it only happens
> because driver is loaded and when you remove driver
> it
> no longer happens, that is not nearly as strong a bit of evidence as the
> crash dump saying your (now unloaded) driver is in the code path.
>
> The driver is simply changing the test so that some curious bit
> of timing no longer occurs and your driver just happens to be in memory
> just
> long enough for whatever bit of dangling callback you have to complete
> before the loader unmaps the image.
>
> Use .reload /unl to load your symbols against the ‘unloaded’ location of
> your driver, analyze the stack back trace very carefully looking at the
> state of the system (and the locals on the stack) owned by the activation
> frame in your driver. Figure out why execution is running through your
> driver after it has unloaded.
>
> Don’t call just yet until you prove that the driver
> improperly cached a pointer to your code and tried to call your driver
> after
> it unloaded for no good reason. Actually, you should be thankful that
> you
> have a definitive way to cause the crash. It will make it easier to find
> what is likely a bug in your driver.
>
> So, do you have any, Timers, DPCs, Work Items, or Callbacks? Do you
> reference count your ‘module’ to prevent DriverUnload() from completing
> until all of these callback capable resources have been drained and
> released?
>
> Good Luck,
> Dave Cattley
> Consulting Engineer
> Systems Software Development
>
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of SatheeshBabu
> Muthupandi
> Sent: Friday, February 13, 2009 7:09 PM
>
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] BSOD with
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver
>
> Dave,
>
> bnadimd5.sys is my driver which is under development. What I’m doing is
> thru
> notify object DLL (took the one from sample MUL driver) installing my
> Intermediate driver. I can see my driver entry gets called but after that
> it
> immediately crashes.
>
> Point here is, I won’t see the crash if there is no TrendMicro
> Software(antivirus software) installed in the system. BSOD occurs only when
> the TrendMicro Software is present.
>
> Protocolbindadapter itself is not get called. BSOD occurs prior to that.
>
> Any clue?
>
> Regards
> Satheesh
> On Fri, Feb 13, 2009 at 3:38 PM, David R. Cattley
> wrote:
> What driver is bnadimd5.sys? Yours?
>
> Turn on driver verifier for your driver and NDIS.SYS. Turn it on for
> the
> 3rd party driver too.
>
> The bugcheck is (as it says) a case where a module has been unloaded
> (bnadimd5.sys) yet a callback occurred (or return through a call occurred)
> in that driver.
>
> The driver did not correctly synchronize its and allowed itself to be
> unloaded when it was not safe to do so. The crash occurred after the
> unload. Since you don’t say exactly all of what you were doing, it could
> be that you had installed your IM driver and that it was being loaded /
> unloaded / reloaded. It might be that the unload prior to the load is
> where
> the real problem is.
>
> Good Luck,
> Dave Cattley
> Consulting Engineer
> Systems Software Development
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> xxxxx@gmail.com
> Sent: Friday, February 13, 2009 6:01 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] BSOD with
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver
>
> Hi All,
>
> When I tried to install my Intermediate driver, right after Driver Entry
> I’m
> seeing BSOD. This happens only when there is a trend micro filter driver
> (antivirus) software is enabled.
> Below are the BSOD logs. Can anybody help me to debug this crash.
>
>
> Use !analyze -v to get detailed debugging information.
>
> BugCheck CE, {f4c72680, 8, f4c72680, 0}
>
>
>
>
>
> Probably caused by : bnadimd5.sys ( bnadimd5+2680 )
>
> Followup: MachineOwner
> ---------
>
> nt!RtlpBreakWithStatusInstruction:
> 807584dc cc int 3
> kd> !analyze -v
>
> *************************************************************************
>

> *
> *
> * Bugcheck Analysis
> *
> *
> *
>
> *************************************************************************
>

>
> DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS (ce)
> A driver unloaded without cancelling timers, DPCs, worker threads, etc.
> The broken driver’s name is displayed on the screen.
> Arguments:
> Arg1: f4c72680, memory referenced
> Arg2: 00000008, value 0 = read operation, 1 = write operation
> Arg3: f4c72680, If non-zero, the instruction address which referenced the
> bad memory
> address.
> Arg4: 00000000, Mm internal code.
>
> Debugging Details:
> ------------------
>
>
>
>
>
>
> WRITE_ADDRESS: f4c72680
>
> FAULTING_IP:
> bnadimd5+2680
> f4c72680 ?? ???
>
> DEFAULT_BUCKET_ID: DRIVER_FAULT
>
> BUGCHECK_STR: 0xCE
>
> PROCESS_NAME: System
>
> CURRENT_IRQL: 1
>
> TRAP_FRAME: f5b2ab80 – (.trap 0xfffffffff5b2ab80)
> ErrCode = 00000010
> eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
> edi=87418350
> eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
> nc
> cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
> efl=00010246
> <unloaded_bnadimd5.sys>+0x2680:
> f4c72680 ?? ???
> Resetting default scope
>
> IP_MODULE_UNLOADED:
> bnadimd5+2680
> f4c72680 ?? ???
>
> LAST_CONTROL_TRANSFER: from 806377bf to 807584dc
>
> STACK_TEXT:
> f5b2a6f0 806377bf 00000003 00000000 00000000
> nt!RtlpBreakWithStatusInstruction
> f5b2a73c 80638743 00000003 c07a6390 00000000 nt!KiBugCheckDebugBreak+0x19
> f5b2aad4 80638b7d 00000050 f4c72680 00000008 nt!KeBugCheck2+0x5e1
> f5b2aaf4 8070f3b1 00000050 f4c72680 00000008 nt!KeBugCheckEx+0x1b
> f5b2ab68 8077ad54 00000008 f4c72680 00000000 nt!MmAccessFault+0x1bd3
> f5b2ab68 f4c72680 00000008 f4c72680 00000000 nt!KiTrap0E+0xe4
> WARNING: Frame IP not in any known module. Following frames may be wrong.
> f5b2abf0 f6f0a9d5 f5b2ac80 f5b2ac18 87838334 <unloaded_bnadimd5.sys>+0x2680
> f5b2ac84 f6f0d073 87418350 8760d518 80bbf460
> NDIS!ndisInitializeBinding+0x1a1
> f5b2ad0c f6f15a03 87418350 87397008 87397098
> NDIS!ndisCheckAdapterBindings+0xf5
> f5b2ad94 f6f08df5 87397008 00000000 86d89020
> NDIS!ndisCheckProtocolBindings+0x13d
> f5b2adac 80a0041e 87397088 00000000 00000000 NDIS!ndisWorkerThread+0xdd
> f5b2addc 8077cb86 f6f08d18 87397088 00000000 nt!PspSystemThreadStartup+0x2e
> 00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16
>
>
> STACK_COMMAND: kb
>
> FOLLOWUP_IP:
> bnadimd5+2680
> f4c72680 ?? ???
>
> SYMBOL_STACK_INDEX: 6
>
> SYMBOL_NAME: bnadimd5+2680
>
> FOLLOWUP_NAME: MachineOwner
>
> MODULE_NAME: bnadimd5
>
> IMAGE_NAME: bnadimd5.sys
>
> DEBUG_FLR_IMAGE_TIMESTAMP: 0
>
> FAILURE_BUCKET_ID: 0xCE_W_bnadimd5+2680
>
> BUCKET_ID: 0xCE_W_bnadimd5+2680
>
> Followup: MachineOwner
> ---------
>
> kd> .trap 0xfffffffff5b2ab80
> ErrCode = 00000010
> eax=f5b2ac80 ebx=87397008 ecx=00000000 edx=00000000 esi=87838334
> edi=87418350
> eip=f4c72680 esp=f5b2abf4 ebp=f5b2ac84 iopl=0 nv up ei pl zr na pe
> nc
> cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
> efl=00010246
> <unloaded_bnadimd5.sys>+0x2680:
> f4c72680 ?? ???
>
> thanks
> satheesh
>
>
> —
> 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
>
>
> —
> 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
>
> — 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
>
> —
> 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
>
> — 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
>
> —
> 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
>
> — 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
>
>
> —
> 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
></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys></unloaded_bnadimd5.sys>

Do you initialize the NDIS Wrapper and register as a layered miniport in
DriverEntry?

I have to assume that the notify object created a root enumerated device
with deviceid which matches your virtual miniport otherwise why would your
driver get loaded at all.

When your DriverEntry() returns (with status success) what is your
DriverObject->AddDevice handler pointing at? It has better be pointing at
the internal NDIS handler for AddDevice() that NDIS puts in place during
Miniport registration.

And you did maintain the order of ?register miniport?, ?register protocol?,
?associate miniport and protocol?, right? The miniport must (successfully)
register before attempting to register the protocol.

Run device manager with the ?show not present devices? environment flag
enabled (I forget the exact name DEVMGR_SHOW_NONPRESENT_DEVICES=1 or
something like that.) Select ?view hidden devices? and expand network
adapters. You should see your virtual miniport(s) (dim). Inspect the
properties of them and make sure that they specify (among other things) that
your driver is the ?service? for the device.

And answer the following question for me:

Regardless of why the driver is being unloaded, why is it that it can be
unloaded without you deregistering your protocol? You *do* have an
MiniportUnload handler, right? What does it do? At the very least it needs
to deregister the protocol and the miniport (just like PASSTHRU and MUX do).

That is your crash bug, not the fact that your driver does not load
properly. The bug is that it does handle ?unload? properly. When you solve
that, then, go looking for the bugs in the NotifyObject and/or driver that
is causing the Virtual NIC DevNode to not start correctly (either because it
is not installed correctly or the driver is busted).

Good Luck,

Dave Cattley

Consulting Engineer

Systems Software Development

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of SatheeshBabu
Muthupandi
Sent: Tuesday, February 17, 2009 3:32 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] BSOD with
DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS -Intermediate driver

David,

Thanks for your reply. Sorry for not making it clear.
I took the logs and pasted here.By looking at the log, it says that *
STATUS_PLUGPLAY_NO_DEVICE* (*c000025e)* after DriverEntry which returned
success.
Because of the above error, system tries to load the driver second time by
calling* *DriverEntry.

Second time DriverEntry tries to load and same failure occurs but referring
to the first time registered entry points at *bnadimd5+2680 *(which is
protocolbindadapter, found by memory watch) which is NULL and leads to BSOD.

FYI,

  • I’m trying this on Windows 2003 server with Service Pack2 Checked
    build.
  • Basically this driver is for adding Multi VLAN feature for our NIC
    driver.
  • my notify object DLL is the sample mux dll with slight modifications
    w.r.to http:</http:> . my driver

Please let me know what else I can add so that you (someone) help me on this
issue.

// Somewhere, you better be setting ntStatus to a return value…

…and PREfast will really check for this.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com