Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jan 2003 15:23:08 -0200
From:      "Daniel C. Sobral" <dcs@newsguy.com>
To:        Peter Wemm <peter@wemm.org>
Cc:        Tim Robbins <tjr@FreeBSD.ORG>, Juli Mallett <jmallett@FreeBSD.ORG>, current@FreeBSD.ORG, kbyanc@FreeBSD.ORG
Subject:   Re: Serious issues with kqueue on sockets on CURRENT.
Message-ID:  <3E2052FC.B490B429@newsguy.com>
References:  <20030111034649.6A35D2A89E@canning.wemm.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Peter, reverting the revisions below *does* fix the problem. Tim has an
alternative patch, though. At any rate, it seems kbyanc's solution was
overly simplistic. But things are broken either way, and I'm not sure
Tim's patch doesn't result in the kind of situation rev 1.134 tried to
fix, nor if his patch actually gets all cases of the bug that results
from 1.134.

At any rate, I think that not receiving any event (after 1.134) is worse
than receiving and event claim to have more bytes than are actually
available (pre 1.134). It's not just Juli who have this problem.
AilleCat, for instance, once she heard on irc that kq had a problem,
tracked the problem *she* was having to the same place.

Peter Wemm wrote:
> 
> Tim Robbins wrote:
> > On Fri, Jan 10, 2003 at 01:30:16AM -0800, Juli Mallett wrote:
> >
> > > Lately, the data field for sockets, which holds bytes ready (in the EVFILT_
> > > READ case) to be read, is computed to be zero.  This means that if you have
> > > a low watermark which is >0 per the kq, THE EVENT WILL NEVER HAPPEN.  Not t
>     o
> > > mention that this means when the event IS triggered properly (if you can
> > > call it that), it is always said to have =ZERO= bytes ready.
> > [...]
> >
> > I can definitely reproduce this here and also fairly angry about it.
> > In addition to what you mentioned, fstat() gives an incorrect st_size
> > result now and it's likely that non-NOTE_LOWAT low watermarks are
> > firing too early as well.
> >
> > Ugly test program @ http://people.freebsd.org/~tjr/kq.c
> 
> In case anybody wants to play, I seem to recall some changes in uipc_socket.c
> that caused some problems (totally hosed the resolver) a while back:
> ----------------------------
> revision 1.134
> date: 2002/11/01 21:27:59;  author: kbyanc;  state: Exp;  lines: +1 -1
> Track the number of non-data chararacters stored in socket buffers so that
> the data value returned by kevent()'s EVFILT_READ filter on non-TCP
> sockets accurately reflects the amount of data that can be read from the
> sockets by applications.
> 
> PR:             30634
> Reviewed by:    -net, -arch
> Sponsored by:   NTT Multimedia Communications Labs
> MFC after:      2 weeks
> ----------------------------
> revision 1.136
> date: 2002/11/05 18:48:46;  author: kbyanc;  state: Exp;  lines: +1 -1
> Fix filt_soread() to properly flag a kevent when a 0-byte datagram is
> received.
> 
> Verified by:    dougb, Manfred Antar <null@pozo.com>
> Sponsored by:   NTT Multimedia Communications Labs
> ----------------------------
> 
> Is this related?
> 
> Cheers,
> -Peter
> --
> Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
> "All of this is for nothing if we don't go to the stars" - JMS/B5
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-current" in the body of the message

-- 
Daniel C. Sobral			(8-DCS)
dcs@newsguy.com
dcs@freebsd.org
capo@professional.bsdconspiracy.net

	Spellng is overated anywy.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E2052FC.B490B429>