New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Npcap's pcap_sendqueue_transmit Causes Windows10 Blue Screen #1398

Open
WangChengZhang opened this Issue Nov 27, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@WangChengZhang

WangChengZhang commented Nov 27, 2018

I need to let the gigabit ethernet adapter work with the full speed(about 950Mbit/s). So I use the pcap_sendqueue_transmit function.
But:
The npcap causes bluescreen.
The wpcap works well but lose some packets probably.

@WangChengZhang WangChengZhang changed the title from pcap_sendqueue_transmit Causes Windows10 Blue Screen to Npcap's pcap_sendqueue_transmit Causes Windows10 Blue Screen Nov 27, 2018

@dmiller-nmap

This comment has been minimized.

dmiller-nmap commented Nov 29, 2018

Thanks for the report! We'll look into it. Does this happen every time you use pcap_sendqueue_transmit, or only when you approach the limits of your network device?

@dmiller-nmap

This comment has been minimized.

dmiller-nmap commented Dec 3, 2018

I'm doing some initial testing, and while I am running into problems getting it to work, I have not seen any blue screen errors. Can you get a minidump crash dump and DiagReport output so we can diagnose the problem? https://nmap.org/npcap/guide/npcap-users-guide.html#npcap-issues

@dmiller-nmap

This comment has been minimized.

dmiller-nmap commented Dec 3, 2018

@WangChengZhang Would you mind sharing a bit of your sample code that uses pcap_sendqueue_transmit? I suspect there is a problem with the order in which the sendqueue functions are being called. Obviously, we don't want Npcap to crash no matter how the user program is written, so this would help us find a reproducible case for your blue screen crash.

@WangChengZhang

This comment has been minimized.

WangChengZhang commented Dec 4, 2018

Okay Daniel...

Some explanations:

1.For this sender,I use 1 circular linked list with 3 pcap_send_queue to store data. And I use 2 threads filling and sending data. Within the main thread,I fill the queue by calling pcap_sendqueue_queue. Within the sending thread,I send the queue by calling pcap_sendqueue_transmit.

2.Each time before I calling pcap_sendqueue_transmit I will call pcap_sendpacket first. Because I need reopen the adapter in the case of an error. Unfortunately,pcap_sendqueue_transmit won't return false in some cases(like computer wakes up from sleep and restarts the adapter). So I need to call pcap_sendpacket judging the state of adapter.

@dmiller-nmap

This comment has been minimized.

dmiller-nmap commented Dec 6, 2018

Thanks for the update. I'll see what I can figure out. I wonder if there's a better way to determine if the adapter handle is still valid?

@dmiller-nmap

This comment has been minimized.

dmiller-nmap commented Dec 10, 2018

Still investigating. I think that in the case where there is a power event that causes Npcap handles to be invalidated, GetLastError can be used to get the error set by the DeviceIoControl function within Packet.dll. You can also check pcap_geterr to see if there is an error set. In this case, pcap_sendqueue_transmit will return a number less than the length of the sendqueue, which I see you are already checking for.

We will work on improving the errors that are returned, but also look for a cause on the BSOD crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment