On a recently built FreeBSD 8.1 amd64 server I'm experiencing segmentation faults when I ctrl-c out of tcpdump on a busy network interface:
lab# tcpdump -ni bce1
tcpdump: WARNING: bce1: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on bce1, link-type EN10MB (Ethernet), capture size 96 bytes
01:52:39.537261 IP 192.168.20.114.51589 > 192.168.20.56.1344: tcp 291
^c
280 packets captured
1622 packets received by filter
822 packets dropped by kernel
Segmentation fault (core dumped)
If I run tcpdump through gdb the issue appears to be when calling free() in libc:
Program received signal SIGSEGV, Segmentation fault.
0x0000000800b276a7 in free () from /lib/libc.so.7
(gdb) bt
#0 0x0000000800b276a7 in free () from /lib/libc.so.7
#1 0x00000008006f5ac5 in pcap_cleanup_live_common () from /lib/libpcap.so.7
#2 0x00000008006f67b8 in pcap_create () from /lib/libpcap.so.7
#3 0x00000008006f563e in pcap_close () from /lib/libpcap.so.7
Anyone run into this before?
Update:
(2010/11/22 16:29) - Discovered culprit
I was able to track down the cause of the seg faults, but not the reason (perhaps the libc library wasn't compiled correctly for the amd64 arch in the FreeBSD 8.1 release?)
If "BPF Zero Copy" is enabled then tcpdump will seg fault when the process is exiting. To test yourself enable it by adding the following to /etc/sysctl.conf
| File: /etc/sysctl.conf |
net.bpf.zerocopy_enable=1
|
then reboot to pick up the change.
-Dave