Ethereal-users: Re: [ethereal-users] Hangs when capturing starts

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gerald Combs <gerald@xxxxxxxx>
Date: Wed, 29 Dec 1999 10:10:42 -0600 (EST)
On Tue, 28 Dec 1999, Steve Simeonidis wrote:

> an strace on the final lines gives me the following:
>
> write(3, "\201\2\2\0[\2\300\3\201\2\2\0^\2\300\3+\1\1\0", 20) = 20
> read(3, 0xbfffe0b8, 32)                 = -1 EAGAIN (Resource
> temporarily unavailable)
> select(4, [3], NULL, NULL, NULL)        = 1 (in [3])
> read(3, "\1\1\362\16\0\0\0\0\r\0@\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32)
> = 32
> gettimeofday({946303854, 167464}, NULL) = 0
> gettimeofday({946303854, 167637}, NULL) = 0
> poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}], 2, 0) = 0
> gettimeofday({946303854, 168193}, NULL) = 0
> write(3, "8\2\4\0\f\0\300\3\0\0\10\0b\2\300\3>\1\7\0a\2\300\3~\0"...,
> 184) = 184ioctl(3, FIONREAD, [0])                 = 0
> poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}], 2, 0) = 0
> recvfrom(7,  <----- hangs here

It looks like you're using the stock libpcap, as Guy pointed out.
A "healthy" libpcap produces the following strace:

30914 09:05:48 poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}], 2, 0) = 0
30914 09:05:48 select(9, [8], NULL, NULL, {0, 250000}) = 1 (in [8], left {0, 250000})
30914 09:05:48 recvfrom(8, "\10\0 }\200\302\0\20{\357;\333\10\0E\10\5\334-\323@\0\363"..., 65535, 0x20, {sa_family=17, sa_data="\10\0\0\0\0\2\0\1\3\6\0\20{\357"}, [20]) = 1514

Notice the call to select() just before the call to recvfrom().

Along with the patch, there are now replacement libpcap RPMs and SRPMs at
http://ethereal.zing.org/~gerald .