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
using pcap_next_ex to capture packet, and I got a lot of return value which is TMOUT #546
Comments
And when I used tcpdump capture packets from the interface eth0, we only to see dozens of packages . |
libpcap 1.5.3 is slightly more than 3 years old, could you check with libpcap 1.8.1 and/or the current git master branch and update if the behaviour is still not what you expect? |
reproduced in libpcap-1.8.1 |
What kernel version? |
Kernel version is 3.10.0-327.36.2.el7.x86_64 |
tcpdump version 4.9.0 '/usr/sbin/tcpdump -Z pcap -p -i any -s 0 -U -C 100 -W 200 -w /var/log/siplogger/sip.pcap udp port 5060 or 5090' There is some debug information:
|
So did that version of libpcap come with the OS or did you build it from source yourself? |
I've built RPMs (tcpdump, libpcap) from the source |
Where "the source" is the source from tcpdump.org, or where "the source" is source RPMs from somewhere, or "the source" is something else? |
Tthe source from http://www.tcpdump.org/#latest-releases |
So what's the content of the |
There is libpcap-1.8.1 log config.log:
|
What does |
There is it:
|
Today we've got issue again.
I have a coredump of the process and ready to send for futher investigation. And I will work on reproducing the issue. |
How to reproduce the issueIssue reproducing under hight load with float IP configured on the servers(2 vms) througth heartbeat.
GDB
|
So why is it calling |
It was disabled by this patch:
Since #380 and #364 issues still open, I'm not delete this patch from the build. |
#1131500 is the bug in which I point out:
and in which Michal Sekletar says:
I will close the issues in question, as modern kernels have the fix. |
|
Note that, with TPACKET_V1 and TPACKET_V2:
|
And even with TPACKET_V3 in pre-3.19 kernels, you'll still get per-packet wakeups, so, with a pre-3.19 kernel, you're stuck with per-packet wakeups no matter what you do. TPACKET_V3 still makes more efficient use of the ring buffer, as it allows multiple packets to be packed into one slot, rather than putting only one packet in a slot even if there's plenty of room for multiple packets, so it's still worth using. However on pre-3.19 kernels, if you're using (Executive summary: if you want to capture packets on Linux, you really want 3.19 or later if you can get it and, if not, you at least want a kernel with the wakeups fixed by applying the appropriate patch, if you can get that.) |
The conclusion of this is that things work as intended with current Linux kernels and current libpcap, so there is nothing to be done, correct? |
That's what I'd say. Current kernels correctly wake up userland, and current libpcap applies a workaround with broken kernels and doesn't apply the workaround with fixed kernels. |
Hi,
I'm running CentOS 7.1 with:
linux 3.10.0
pcap 1.5.3-3
When I run my app , which I call pcap_open_live(DevName, PCAP_BUF_SIZE, promisc, 1000, szErrbuf) to create a handler, use pcap_next_ex to capture packet.
And I got the follow strace log, It looks like something goes wrong.
there was thousands of pcap_next_ex called in one second, but I got the TMOUT return value.
In the app, I sleep 1 ms every 16 pcap_next_ex called.
Process 21903 attached
18:02:40.754761 select(1, NULL, NULL, NULL, {0, 282}) = 0 (Timeout) <0.000734>
18:02:40.755568 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000013>
18:02:40.755625 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000017>
18:02:40.755670 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000006>
18:02:40.755695 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000006>
18:02:40.755720 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.755758 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.755798 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.755836 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.755876 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.755922 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.755960 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000009>
18:02:40.755996 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000009>
18:02:40.756036 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.756076 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000279>
18:02:40.756399 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000086>
18:02:40.756536 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000222>
18:02:40.756805 select(1, NULL, NULL, NULL, {0, 1000}) = 0 (Timeout) <0.001517>
18:02:40.758362 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000012>
18:02:40.758426 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000084>
18:02:40.758550 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000012>
18:02:40.758594 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.758633 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.758680 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000009>
18:02:40.758718 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.758754 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.758793 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.758831 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000009>
18:02:40.758872 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.758914 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000016>
18:02:40.758957 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.758994 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000016>
18:02:40.759038 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.759073 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.759108 select(1, NULL, NULL, NULL, {0, 1000}) = 0 (Timeout) <0.001527>
18:02:40.760666 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000014>
18:02:40.760714 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.760756 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.760800 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000009>
18:02:40.760842 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.760877 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.760914 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.760962 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.761005 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000015>
18:02:40.761048 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.761088 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000299>
18:02:40.761619 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000012>
18:02:40.761671 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000012>
18:02:40.761712 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.761750 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.761789 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.761828 select(1, NULL, NULL, NULL, {0, 1000}) = 0 (Timeout) <0.001310>
18:02:40.763172 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.763219 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000014>
18:02:40.763261 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.763297 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.763333 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.763370 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000012>
18:02:40.763407 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.763463 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000008>
18:02:40.763500 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.763540 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.763576 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.763612 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000017>
18:02:40.763654 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000011>
18:02:40.763691 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.763727 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000009>
18:02:40.763767 poll([{fd=54, events=POLLIN}], 1, 1000) = 1 ([{fd=54, revents=POLLIN}]) <0.000010>
18:02:40.763807 select(1, NULL, NULL, NULL, {0, 1000}) = 0 (Timeout) <0.001751>
The text was updated successfully, but these errors were encountered: