Date: Tue, 01 Aug 2000 22:53:19 CDT From: "Steve Dispensa" <dispensa@hotmail.com> To: freebsd-net@freebsd.org Subject: libpcap, BPF, and 100% CPU Message-ID: <20000802035319.36202.qmail@hotmail.com>
next in thread | raw e-mail | index | archive | help
I'm not sure if this is the right forum for this, but... I'm working on a packet-capture program for some protocol analysis of a proprietary UDP-based protocol. I'm using libpcap on FreeBSD 4.0-release. It's thread-based, with a thread for capturing and a thread for reporting. I'm compiling it with 'cc -pthread -lpcap -g -o sniff sniff.c' - which should link it against the right libraries for thread support. The problem is that it nails the processor at 100% (I've tested the same bpf program with tcpdump, and it idles at 0%). Then, after some time (1-3 minutes), the box either reboots (!) or the program just dumps core. Occasionally I get "segmentation fault"; other times I get "bus error". Now, I'm pretty sure I'm doing something wrong here - I've run pcap programs before on other platforms without 100% CPU usage - but the box rebooting itself sounds like a bad (hardware) sign. Any ideas? --Steve ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000802035319.36202.qmail>