From owner-freebsd-hackers Wed May 31 17:45: 0 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id 3FFA637B935 for ; Wed, 31 May 2000 17:44:57 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 1 Jun 2000 01:44:56 +0100 (BST) To: "David E. Cross" Cc: Guy Helmer , Matthew Dillon , freebsd-hackers@FreeBSD.ORG Subject: Re: PR #10971, not dead yet. In-reply-to: Your message of "Wed, 31 May 2000 17:51:38 EDT." <200005312151.RAA86135@cs.rpi.edu> Date: Thu, 01 Jun 2000 01:44:55 +0100 From: Ian Dowse Message-ID: <200006010144.aa98926@salmon.maths.tcd.ie> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200005312151.RAA86135@cs.rpi.edu>, "David E. Cross" writes: >though. Especially confusing is the following sequence of events: > > 41096 ypserv CALL select(0x10,0x8051040,0,0,0xbfbff518) > 41096 ypserv PSIG SIGCHLD caught handler=0x804c75c mask=0x0 code=0x0 ... > 41096 ypserv RET sigreturn JUSTRETURN > 41096 ypserv CALL gettimeofday(0xbfbff510,0) > 41096 ypserv RET gettimeofday 0 > 41096 ypserv CALL read(0x1c,0x80f3fa0,0xfa0) > 41096 ypserv GIO fd 28 read 4000 bytes > >Note that the select returned with -1, with errno set to 4, and it >did not re-enter the select loop, but just started to read data. Also note A quick glance at the RPC library suggests a possible reason for this sequence. It appears there is a bug in svc_{unix,tcp}.c's handling of EINTR returns from select() - the code seems to assume that a 'continue' inside a do-while loop skips the while condition. Try the patch below (note that I don't use ypserv, I haven't checked if ypserv uses this code etc etc, so this may have nothing to do with your problem). Ian Index: svc_tcp.c =================================================================== RCS file: /home/iedowse/CVS/src/lib/libc/rpc/svc_tcp.c,v retrieving revision 1.18 diff -u -r1.18 svc_tcp.c --- svc_tcp.c 2000/01/27 23:06:41 1.18 +++ svc_tcp.c 2000/06/01 00:21:26 @@ -360,6 +360,7 @@ if (tmp1.tv_sec < 0 || !timerisset(&tmp1)) goto fatal_err; delta = tmp1; + FD_CLR(sock, fds); continue; case 0: goto fatal_err; Index: svc_unix.c =================================================================== RCS file: /home/iedowse/CVS/src/lib/libc/rpc/svc_unix.c,v retrieving revision 1.7 diff -u -r1.7 svc_unix.c --- svc_unix.c 2000/01/27 23:06:42 1.7 +++ svc_unix.c 2000/06/01 00:23:25 @@ -402,6 +402,7 @@ if (tmp1.tv_sec < 0 || !timerisset(&tmp1)) goto fatal_err; delta = tmp1; + FD_CLR(sock, fds); continue; case 0: goto fatal_err; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message