Re: How is possible that NDIS_PACKET->Head->MappedSystemVa is page



It's entirely possible that you're corrupting something else, leading to a
bogus address where you found it.

Double-check your code in the crashing path; you probably have a bug. Using
Driver Verifier is good; you might also google "ndis verifier" and turn that
on.

Also, testing across different Oses can sometimes make subtle bugs like this
show up differently, which might give you what you need. Try XP gold vs.
2003 server SP1 - I've seen a couple of bugs recently that showed up
differently in those two environments.

-sd


On 5/7/06 6:44 AM, in article
2FB6669F-4941-46AC-A06E-A4E4DD08C20B@xxxxxxxxxxxxx, "Peter"
<Peter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

All what details I wrote in previous message I have from "!analyze -v",
and from searching stack.
Code crashes inside of: NdisMIndicateReceivePacket(),
In my case this function is called from IRQL==DISPATCH_LEVEL.
I dont access directly or undirectly NDIS_BUFFERS in my code before crash .
This bug is not reproducable, I met it only once.

How is in principle possible that:
NDIS_PACKET with NDIS_BUFFER inside it are created
only with help of documented functions and in memory system stress
MappedSystemVa is paged ?
How can I to avoid this ?

Peter


"Stephan Wolf [MVP]" wrote:

First, please do not make any assumptions on the format of an
NDIS_BUFFER, even if it is currently an MDL in NT-based Windows.

Second, if you need to access the virtual buffer of an NDIS_BUFFER you
should use NdisQueryBufferSafe() to get the virtual buffer address.
NdisQueryBufferSafe() will take care of locking any related pages if
necessary.

Third, try the "!analyze -v" debugger command to get a more detailed
description (including a stack trace) of the bugcheck.

Also try and enable NDIS debug tracing, see

"NDIS Driver Debugging Guidelines"
http://www.microsoft.com/whdc/device/network/NDIS/ndisdebug.mspx

"How to enable NDIS debug tracing"
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q164459

"INFO: NDIS Debug Tracing and Kernel Debugger Extensions"
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q248413

Stephan
---
Peter wrote:
I met bug:
DRIVER_IRQL_NOT_LESS_OR_EQUAL,

Bug occurred inside of: NdisMIndicateReceivePacket(...,myPacket, 1);
called from my driver.
Amazing is that address of memory referenced is inside of NDIS_PACKET:
MyPacket->Head->MappedSystemVa.
I see in memory in debugger that MappedSystemVa is not displayable ant it
show error ERROR_READ_FAULT, so it is probably paged.

I met this bug in system with debug versions of kernel,hal and ndis.sys
and on system running under memory stress with driver verifier turned on my
driver and ndis.sys.
MyPacket was allocated with NdisDprAllocatePacket() and buffers are created
by copying from original packet with help of NdisCopyBuffer().
How can be possible that packet created by such way has paged
Head->MappedSystemVa ?
What can I to do in my code to avoid of this ?

Peter



.



Relevant Pages

  • Re: How is possible that NDIS_PACKET->Head->MappedSystemVa is page
    ... Also try and enable NDIS debug tracing, ... "NDIS Driver Debugging Guidelines" ... NDIS Debug Tracing and Kernel Debugger Extensions" ... Amazing is that address of memory referenced is inside of NDIS_PACKET: ...
    (microsoft.public.development.device.drivers)
  • Re: How is possible that NDIS_PACKET->Head->MappedSystemVa is pageable
    ... Also try and enable NDIS debug tracing, ... "NDIS Driver Debugging Guidelines" ... NDIS Debug Tracing and Kernel Debugger Extensions" ... Amazing is that address of memory referenced is inside of NDIS_PACKET: ...
    (microsoft.public.development.device.drivers)
  • Re: How is possible that NDIS_PACKET->Head->MappedSystemVa is page
    ... If the bug repros on Win2k, say, and also server 2k3 ... Also try and enable NDIS debug tracing, ... "NDIS Driver Debugging Guidelines" ... NDIS Debug Tracing and Kernel Debugger Extensions" ...
    (microsoft.public.development.device.drivers)
  • Re: A bluescreen caused by tcpip.sys.
    ... You should enable driver verifier on tcpip and your IM driver and attach a kernel debugger for live debugging. ... We think that our application or driver triggers a bug in tcpip.sys, ...
    (microsoft.public.development.device.drivers)
  • Re: How is possible that NDIS_PACKET->Head->MappedSystemVa is page
    ... I dont tell that I have not bug but confirming above info is important for me. ... Also try and enable NDIS debug tracing, ... "NDIS Driver Debugging Guidelines" ... NDIS Debug Tracing and Kernel Debugger Extensions" ...
    (microsoft.public.development.device.drivers)