-
Notifications
You must be signed in to change notification settings - Fork 544
Npcap 0.9990: Disrupts loopback connectivity/consumes whole core on WS2016 #26
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
Comments
What happens with Npcap 0.9991? They made some changes in 0.9991 that might address this. |
Thanks for the report. We will look into this; I made a fix (5a90689) to an issue nobody reported related to loopback traffic filtering, but I'm not sure if it's related. |
@guyharris Unfortunately, Npcap 0.9991 is affected as well. @dmiller-nmap Not sure if it's the same issue, but on our end, we ran this problem down to open handle and memory leaks in On Windows Server 2016, this issue consistently reproduces with Npcap 0.9990 and 0.9991, but not 0.993. But on Windows 10 1909, it reproduces with 0.993 as well -- and even with WinPcap 4.1.3. As the number of open handles accumulates, network performance degrades significantly with 0.999x, but not with other versions. As we need to support WinPcap as well as Npcap, we are currently developing a workaround that avoids the usage of |
to fill in the list.
To find the IPv4 addresses, it calls ... To get all the IPv6 addresses for the adapter, it calls
...calling So we end up calling Oh, and then This code needs some work. I have a version of libpcap's pcap-npf.c where The current master branch of libpcap includes direct support for AirPcap devices (tested on a Windows VM; it works). If we were to remove the AirPcap support from Npcap, and leave that up to libpcap, that would leave only the DAG devices. Endace currently doesn't support Windows, only Linux and FreeBSD, and libpcap already has DAG support, so that might be another case to leave up to libpcap; were Endace to support Windows again, they'll probably either contribute whatever changes are needed to pcap-dag.c or I'd nag them into doing so. :-) So the first question is whether, were packet.dll not to provide If not, it could be removed, and If it is necessary, perhaps it could just be a list of names, not full interface information. Alternatively, a |
...oh, and |
I'm not sure we need |
As a temporary workaround, you can disable all Loopback capture functions by setting the Registry DWORD value |
@dmiller-nmap This happens to remediate the leak on WS2016 where it was originally reported, but on W10 1909 the leak still reproduces as of 0.9991 (and even 0.993 which did not have loopback capture functionality in that form). So this must not be the only leak in that mess of a function... |
I've filed #169 for the interface-enumeration changes I mentioned. |
Dan (@dmiller-nmap) had some great ideas on this when we chatted today: I've tried in the past to make the loopback initialization functions conditional on actually needing them, but it didn't work exactly right, so I ended up backing those changes off a bit. The changes I've made recently are the latest attempt. We really want to avoid registering all our WFP resources until they're really needed, because some people have problems if that's even touched. But for some reason, it seems the registration doesn't work. I've got a debugger paused at the moment about to find out if the very first registration works and subsequent ones fail, or what. But #169 may allow us to back out these changes and still keep most of the benefit. Because it wouldn't matter very much if everything gets initialized right away when you open an adapter except that each adapter gets opened multiple times in a single pcap_findalldevs() call. So what I'm envisioning based on Guy's suggestions is this:
|
So the per-interface information that libpcap currently uses or may use in the future is:
If there were both an ioctl - and corresponding packet.dll routine, unless you decide to directly expose the BIOC ioctls and a routine to allow direct ioctl calls - to get the information for all adapters and a routine to get the information only for the currently open adapter, that would be useful (either now or in the future). |
From chat with @dmiller-nmap today: "We partially addressed this in Npcap 0.9992 by gating off the loopback functionality, but there's still a chance that if someone explicitly started a loopback capture there it would have the same result. It's possible even a MODE_STAT capture (just packet statistics) could trigger it, like Wireshark uses for their sparkline graphs. We just really don't know what the underlying cause is. Who knows, was a weird interaction between the WFP callback stuff and the worker thread queue that only existed in 0.9991." So we're leaving this open for now and watching to see whether we get further reports that we can investigate. |
Wireshark doesn't use MODE_STAT for the sparklines; it uses regular capture and, for each packet seen, just counts it, and the counts are used for the sparklines. (It has to work on UN*X, so it has to work on platforms without |
I wish I could have found this before Npcap 0.9995, but it'll be fixed in next release. |
Greetings,
We have reports from multiple users that Npcap version 0.9990 intermittently disrupts connectivity on the loopback interface (causing connections made on 127.0.0.1 to time out). The issue seems isolated to Windows Server 2016, with isolated reports for WS2019. When it happens, the System process is seen to consume a whole CPU. The problem is resolved when Npcap is downgraded to 0.993 (the version we bundled previously). Has this been a known issue, possibly addressed in 0.9991? The similar issues I'm finding are either Windows 10 or Windows 7.
P.S. This happens despite our software not capturing anything from NPF_Loopback (not even opening a pcap handle on that adapter).
The text was updated successfully, but these errors were encountered: