Date: Thu, 01 Jun 2000 01:44:55 +0100 From: Ian Dowse <iedowse@maths.tcd.ie> To: "David E. Cross" <crossd@cs.rpi.edu> Cc: Guy Helmer <ghelmer@cs.iastate.edu>, Matthew Dillon <dillon@apollo.backplane.com>, freebsd-hackers@FreeBSD.ORG Subject: Re: PR #10971, not dead yet. Message-ID: <200006010144.aa98926@salmon.maths.tcd.ie> In-Reply-To: Your message of "Wed, 31 May 2000 17:51:38 EDT." <200005312151.RAA86135@cs.rpi.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006010144.aa98926>
