From owner-freebsd-stable Thu Sep 14 15: 7:45 2000 Delivered-To: freebsd-stable@freebsd.org Received: from gatekeeper.tsc.tdk.com (gatekeeper.tsc.tdk.com [207.113.159.21]) by hub.freebsd.org (Postfix) with ESMTP id 6E66A37B443 for ; Thu, 14 Sep 2000 15:07:39 -0700 (PDT) Received: from imap.gv.tsc.tdk.com (imap.gv.tsc.tdk.com [192.168.241.198]) by gatekeeper.tsc.tdk.com (8.8.8/8.8.8) with ESMTP id PAA14732; Thu, 14 Sep 2000 15:07:33 -0700 (PDT) (envelope-from gdonl@tsc.tdk.com) Received: from salsa.gv.tsc.tdk.com (salsa.gv.tsc.tdk.com [192.168.241.194]) by imap.gv.tsc.tdk.com (8.9.3/8.9.3) with ESMTP id PAA88990; Thu, 14 Sep 2000 15:07:32 -0700 (PDT) (envelope-from Don.Lewis@tsc.tdk.com) Received: (from gdonl@localhost) by salsa.gv.tsc.tdk.com (8.8.5/8.8.5) id PAA27239; Thu, 14 Sep 2000 15:07:32 -0700 (PDT) From: Don Lewis Message-Id: <200009142207.PAA27239@salsa.gv.tsc.tdk.com> Date: Thu, 14 Sep 2000 15:07:31 -0700 In-Reply-To: <14785.15822.898420.198946@onceler.kciLink.com> References: <14785.12095.673316.885249@onceler.kciLink.com> <200009142046.NAA26980@salsa.gv.tsc.tdk.com> <14785.15822.898420.198946@onceler.kciLink.com> X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) To: Vivek Khera , stable@FreeBSD.ORG Subject: Re: negative proccnt Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sep 14, 5:06pm, Vivek Khera wrote: } Subject: Re: negative proccnt } >>>>> "DL" == Don Lewis writes: } } DL> It might cut down on the number of complaints, but not eliminate them. } DL> Anyway, proccnt shouldn't even go to 0 for uid 0, since init is always } DL> running. } } DL> Is there anything unusual running on this machine? Also, your machine } DL> seems to be going through a lot of processes, since this message could } DL> only occur as a result of a fork(), exit(), or one of the setuid family } DL> of syscalls. } } The main thing going on is that the Lyris mail list server is running } under linux emulation. Lyris uses linux threads, which initiate a new } process under freebsd. Unfortunatley, these thread-processes are not } reaped so my proc table gets quite full, and I need to stop and } restart lyris once per hour to keep the number of zombies low. I believe the problem is here in fork1(): /* * Increment the count of procs running with this uid. Don't allow * a nonprivileged user to exceed their current limit. */ ok = chgproccnt(p1->p_cred->p_uidinfo, 1, p1->p_rlimit[RLIMIT_NPROC].rlim_cur); if (uid != 0 && !ok) { /* * Back out the process count */ nprocs--; return (EAGAIN); } If chgproccnt() failes because the limit would be exceeded, the proccnt won't be incremented, but the following test will let the fork happen anyway if uid is 0. The eventual exit() decrements proccnt and may result in an underflow. As a workaround, you can bump the process limit for root and/or reap processes more often. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message