From owner-freebsd-hackers Thu Jun 4 02:07:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA01872 for freebsd-hackers-outgoing; Thu, 4 Jun 1998 02:07:05 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from heron.doc.ic.ac.uk (X6lYAd99giAqJpMgq885WTTAX3MzDyvc@heron.doc.ic.ac.uk [146.169.46.3]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id CAA01866 for ; Thu, 4 Jun 1998 02:06:51 -0700 (PDT) (envelope-from njs3@doc.ic.ac.uk) Received: from oak66.doc.ic.ac.uk [146.169.33.66] ([xTjkexZ3pfwXxS8F9VMsQ8+7ljCtaPKO]) by heron.doc.ic.ac.uk with smtp (Exim 1.62 #3) id 0yhVyC-0004XQ-00; Thu, 4 Jun 1998 10:06:00 +0100 Received: from njs3 by oak66.doc.ic.ac.uk with local (Exim 1.62 #3) id 0yhVyB-0000hZ-00; Thu, 4 Jun 1998 10:05:59 +0100 From: njs3@doc.ic.ac.uk (Niall Smart) Date: Thu, 4 Jun 1998 10:05:59 +0100 In-Reply-To: Dmitry Kohmanyuk "Re: Code Logic Question in 2.2 RELENG" (Jun 3, 11:14pm) X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: dk+@ua.net, barry@Lustig.COM Subject: Re: Code Logic Question in 2.2 RELENG Cc: freebsd-hackers@FreeBSD.ORG, serge@yahoo.com Message-Id: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Jun 3, 11:14pm, Dmitry Kohmanyuk wrote: } Subject: Re: Code Logic Question in 2.2 RELENG > In article <19980603171959.17140.qmail@devious.lustig.com> you wrote: > > Does it make sense to have portmap fail when svc_run returns or would it > > make more sense to try and recover and restart the loop? I've had portmap > > abort a few times now, and the only easy remedy is a reboot of the machine. > > If I try and restart portmap, I have to find all of the programs that > > registered with it and restart them. Any suggestions? By the way, this is > > from RELENG_2_2 cvsupped yesterday. > > > This is from portmap.c: > > > /* additional initializations */ > > check_startup(); > > (void)signal(SIGCHLD, reap); > > svc_run(); > > syslog(LOG_ERR, "svc_run returned unexpectedly"); > > abort(); > > this bites me from time to time... see end of this message for workaround... Damn, I saw this bugs ages ago here and a patch was posted (by Tim Hoek I think). How come it wasn't committed to -stable too? Yet another example of an important and easily fixed problem for which a patch is available only making it into -current. The problem is that the signal handler clobbers errno. > what bothers me here is how come that select() returns -1 and yet > errno != EINTR. According to man page, it should be then one of > EBADF or EINVAL, none of which can occur... > > here is a promised workaround, running on production NIS server, > run from crontab every few minutes. With it, FreeBSD proves > itself as a very stable operating system: Please try the following patch, or wait for a couple of days until it gets committed to -stable and cvsup. *** /usr/src/usr.sbin/portmap/portmap.c Thu Jun 4 10:02:58 1998 --- /usr/src/usr.sbin/portmap/portmap.c Thu Jun 4 10:02:49 1998 *************** *** 85,90 **** --- 85,91 ---- */ #include + #include #include #include #include *************** *** 604,608 **** --- 605,613 ---- void reap() { + int save_errno; + + save_errno = errno; while (wait3((int *)NULL, WNOHANG, (struct rusage *)NULL) > 0); + errno = save_errno; } Niall To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message