From owner-freebsd-net Tue Aug 1 20:54:53 2000 Delivered-To: freebsd-net@freebsd.org Received: from hotmail.com (f79.law10.hotmail.com [64.4.15.79]) by hub.freebsd.org (Postfix) with SMTP id CD38237BF9B for ; Tue, 1 Aug 2000 20:54:50 -0700 (PDT) (envelope-from dispensa@hotmail.com) Received: (qmail 36203 invoked by uid 0); 2 Aug 2000 03:53:19 -0000 Message-ID: <20000802035319.36202.qmail@hotmail.com> Received: from 209.242.124.252 by www.hotmail.com with HTTP; Tue, 01 Aug 2000 20:53:19 PDT X-Originating-IP: [209.242.124.252] From: "Steve Dispensa" To: freebsd-net@freebsd.org Subject: libpcap, BPF, and 100% CPU Date: Tue, 01 Aug 2000 22:53:19 CDT Mime-Version: 1.0 Content-Type: text/plain; format=flowed Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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