[ntp:questions] Re: ACTS - too many recvbufs allocated (40) (Correct the Version of ntp-dev)

Danny Mayer mayer at gis.net
Sat Feb 12 02:54:24 UTC 2005


At 08:03 AM 2/10/2005, Ronan Flood wrote:
>Danny Mayer <mayer at gis.net> wrote:
>
> > The quick fix is to change the following lines in ntpd/ntp_io.c in
> > input_handler():
> >          rb->recv_length =
> >              read(fd, (char *)&rb->recv_space, (unsigned)i);
> >
> >          if (rb->recv_length == -1)
> >          {
> >                  netsyslog(LOG_ERR, "clock read fd %d: %m", fd);
> >                  freerecvbuf(rb);
> >                  goto select_again;
> >          }
> > to:
> >
> >          rb->recv_length =
> >              read(fd, (char *)&rb->recv_space, (unsigned)i);
> >
> >          if (rb->recv_length <= 0 || errno != 0)
> >          {
> >                  netsyslog(LOG_ERR, "clock read fd %d: %m", fd);
> >                  freerecvbuf(rb);
> >                  goto select_again;
> >          }
> >
> > This should take care of the problem. I will put a better fix into the
> > sources over the next few days.
>
>That addresses the symptom rather than the cause, which is a hangup
>owing to carrier dropping.  With the above change in place, I'd expect
>a continuous stream of "clock read" messages, CPU maxed, and no other
>input will happen because "goto select_again" picks up the error condition
>each time round and never does anything else.  "continue" would be better
>if you have an error condition: move on to the next clock/interface.
>That was my experience dealing with PPS on a SunFire V210 serial port
>under Solaris 8 -- see comment #23 on bugzilla id 341
>
>   http://bugzilla.ntp.org/show_bug.cgi?id=341#c23
>
>Is the code in refclock_open() to turn off CLOCAL if DSR is on, in the
>right place?  That's for PPS according to the comment, so maybe should
>be in atom_start(), and independently in drivers that handle PPS directly
>themselves?

Yes, you're right. I changed the goto's to continue but it didn't help.
It turns out that this is in a tight double loop and never gets out.
I removed the two loops and things start to work again. The goto's
shouldn't be there at all for a select that still has fd's to check.
I'm still working on this.

Danny

>--
>                       Ronan Flood <R.Flood at noc.ulcc.ac.uk>
>                         working for but not speaking for
>              Network Services, University of London Computer Centre
>      (which means: don't bother ULCC if I've said something you don't like)
>_______________________________________________
>questions mailing list
>questions at lists.ntp.isc.org
>https://lists.ntp.isc.org/mailman/listinfo/questions




More information about the questions mailing list