In message <[EMAIL PROTECTED]>, "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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to