!ndiskd bugs (was: NdisMIndicateStatus crashing driver)

(changing subject line so we can veer off topic with impunity)

Ok this drags up a silly and unnecessarily complicated issue in !ndiskd. The short answer is to use “!miniport” (with no ‘s’) instead of !miniports.


In the !ndiskd from WDK 7.0, there were actually two extensions: !miniports and !gminiports. The former only showed STARTED miniports, while the latter showed ALL miniports.

In the !ndiskd from WDK 7.1, I tried to simplify things a little by renaming !gminiports to !miniport (no ‘s’). Meanwhile !miniports (with an ‘s’) was left mostly unchanged. That means that !miniport and !miniports can show different output [!], with the former being a superset of the latter. Miniports that are added, but not fully started, will only show up in !miniport. This is clearly a ridiculous situation, and a totally unnecessary point of confusion.

But – you’re in luck. This is the exact right moment in time to make feature requests and file bug reports on !ndiskd. (By the way, there have already been many improvements in the !ndiskd that ships with “Developer Preview” release, and we’ve got a few more killer features in the pipeline for the upcoming beta.)

So, thanks for reminding me of this; I will fix !miniports to always return the same set of miniports that !miniport returns, i.e., ALL miniports. If anybody has any other complaints about !ndiskd, please air them now.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Wednesday, October 26, 2011 5:23 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] NdisMIndicateStatus crashing driver

[veering off topic]

I am presently looking at a crash dump (not the OP’s situation at all) in which an IM driver upper edge miniport instance is very much ‘created’ and post it’s MiniportInitialize() call where NDIS is in the midst of brining the MP up (the relevant stack looks like this):

nt!KiSwapThread+0x266
nt!KiCommitThreadWait+0x1df
nt!KeWaitForSingleObject+0x393
ndis!ndisQuerySetMiniportEx+0x1f9
ndis!ndisMDoMiniportOp+0xad
ndis!ndisGetMiniportInfo+0xc76
ndis!ndisMInitializeAdapter+0xae3
ndis!ndisInitializeAdapter+0x10a
ndis!ndisPnPStartDevice+0x130
ndis!ndisIMInitializeDeviceInstance+0x5c
ndis!NdisIMInitializeDeviceInstanceEx+0x101

and the output of !ndiskd.minports has absolutely zilch on this MP instance.
In other words, it does not yet show in whatever NDIS has for a global list of miniport instances.

So I am not entirely sure I would buy into the surety that if a MP is not
shown in !ndiskd.miniports that it (the MP instance) does not exist.

NDISKD is a hugely useful tool no doubt but like any tool, it takes some knowledge to apply it usefully.

[/veering off topic]

Regards,
Dave Cattley


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

Thanks, BTW. The tool saves my bacon on a regular basis.

Is there a specific alias you would like to collect feature suggestions & problem reports on or should it come through connect or (as the Car Talk guys say) written on the back of a $20 bill?

Having just recently written a debugger script that walks all of the allocates in a packet pool and dumps out allocated packets in a witch-hunt for why so darn many packets were getting leaked, I would say my most topical request would be to carry on extending the !ndiskd.pktpools ‘good start’ with the ability to dump info (and packets!) from a specified pool.

The support of NBLs (my favorites at present, that OOB/Extenion data is intelligble and you can spin the packet data to NetMon for decoding) is great. The support for packets, well, seems like it got left behind :(. It seems like at times the !ndiskd.pkt extension just outputs zeros for things that a dt -r2 ndis!_NDIS_PACKET shows is clearly not ‘zeros’. Display of OOB and Extension data would be nice. I realize that there is not much fun in tuning up that has-been bit of pre NDIS6 support but hey, you asked.

Regards,
Dave Cattley

OSR’s forum is usually an effective way to get my attention, as long as the thread’s subject line says “NDIS”. (Somehow I can’t seem to find any time to read 600 messages with “C++” in the subject line.) If you don’t want to air your concerns in an open forum, you can also reach the NDIS team through the contact link on the NDIS blog, or the NDIS 6 feedback alias we’ve handed out at WinHECs.

Your suspicion is correct that nobody has given any attention to the NDIS 5 extensions. !pkt, !pktpools, !findpacket, and !taskoffload are completely unchanged from WDK 7.0. I’ll take a look at the first two and see if there’s anything really gross we’re doing, but I don’t want to make them too fancy or else people might get the wrong message about NDIS 5’s deprecation. (Windows Developer Preview doesn’t have any first-party NDIS 5 drivers anymore, so there’s very little internal demand for a working !pkt.)

The NetMon feature hasn’t been announced yet :slight_smile: Glad you stumbled across it and find it useful. I was recently mulling over a !for_each_miniport sort of extension… it sounds like some sort of !for_each_nbl might also be useful? (I kinda wish dbgscript had a programming model that made it more natural to iterate over “objects”. Like PowerShell.)

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Dave Cattley
Sent: Thursday, October 27, 2011 6:06 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] !ndiskd bugs (was: NdisMIndicateStatus crashing driver)

Thanks,?BTW.?? The tool?saves my bacon on a regular basis.
?
Is there a specific alias?you would like to collect?feature suggestions & problem reports on or should it come through connect or (as the Car Talk guys say) written on the back of a $20 bill?
?
Having just recently written a debugger script that walks all of the allocates in a packet pool and dumps out allocated packets in a witch-hunt for why so darn many packets were getting leaked, I would say my most topical request would be to carry on extending the !ndiskd.pktpools ‘good start’ with the ability to dump info (and packets!) from a specified pool.
?
The support of NBLs (my favorites at present, that OOB/Extenion data is intelligble and you can spin the packet data to NetMon for decoding) is great.? The support for packets, well, seems like it got left behind :(.??? It seems like at times the !ndiskd.pkt extension just outputs zeros for things that a dt -r2 ndis!_NDIS_PACKET shows is clearly not ‘zeros’.?? Display of OOB and Extension data would be nice.?? I realize that there is not much fun in tuning up that has-been bit of pre NDIS6 support but hey, you asked.
?
Regards,
Dave Cattley


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

Thank-you and thanks for the effort put into this tool and the debugging
assets around NDIS in general that have been made available through the WDK.

WRT to NDIS5 - well, it might be dead in Redmond but … :wink:

2014 is a long way off and even so, we will be looking at crash dumps well
beyond that. Maybe if a couple more public symbols showed up in NDIS.PDB
some enterprising stuck-in-NDIS5 driver dev (or an enslaved intern) could
put together some additional extensions ‘outside’ the walls of Redmond.

The !for_each_xxx ideas are interesting. Hopefully the idea will blossom
with a way to control what ‘list’ to traverse (so for example, I might want
to only iterate over minports from a specific miniport driver or over the
global miniport list).

Regards,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jeffrey Tippet
Sent: Thursday, October 27, 2011 6:30 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] !ndiskd bugs (was: NdisMIndicateStatus crashing driver)

OSR’s forum is usually an effective way to get my attention, as long as the
thread’s subject line says “NDIS”. (Somehow I can’t seem to find any time
to read 600 messages with “C++” in the subject line.) If you don’t want to
air your concerns in an open forum, you can also reach the NDIS team through
the contact link on the NDIS blog, or the NDIS 6 feedback alias we’ve handed
out at WinHECs.

Your suspicion is correct that nobody has given any attention to the NDIS 5
extensions. !pkt, !pktpools, !findpacket, and !taskoffload are completely
unchanged from WDK 7.0. I’ll take a look at the first two and see if
there’s anything really gross we’re doing, but I don’t want to make them too
fancy or else people might get the wrong message about NDIS 5’s deprecation.
(Windows Developer Preview doesn’t have any first-party NDIS 5 drivers
anymore, so there’s very little internal demand for a working !pkt.)

The NetMon feature hasn’t been announced yet :slight_smile: Glad you stumbled across it
and find it useful. I was recently mulling over a !for_each_miniport sort
of extension… it sounds like some sort of !for_each_nbl might also be
useful? (I kinda wish dbgscript had a programming model that made it more
natural to iterate over “objects”. Like PowerShell.)

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dave Cattley
Sent: Thursday, October 27, 2011 6:06 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] !ndiskd bugs (was: NdisMIndicateStatus crashing driver)

Thanks,?BTW.?? The tool?saves my bacon on a regular basis.
?
Is there a specific alias?you would like to collect?feature suggestions &
problem reports on or should it come through connect or (as the Car Talk
guys say) written on the back of a $20 bill?
?
Having just recently written a debugger script that walks all of the
allocates in a packet pool and dumps out allocated packets in a witch-hunt
for why so darn many packets were getting leaked, I would say my most
topical request would be to carry on extending the !ndiskd.pktpools ‘good
start’ with the ability to dump info (and packets!) from a specified pool.
?
The support of NBLs (my favorites at present, that OOB/Extenion data is
intelligble and you can spin the packet data to NetMon for decoding) is
great.? The support for packets, well, seems like it got left behind :(.???
It seems like at times the !ndiskd.pkt extension just outputs zeros for
things that a dt -r2 ndis!_NDIS_PACKET shows is clearly not
‘zeros’.?? Display of OOB and Extension data would be nice.?? I realize that
there is not much fun in tuning up that has-been bit of pre NDIS6 support
but hey, you asked.
?
Regards,
Dave Cattley


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