From owner-freebsd-stable@FreeBSD.ORG Fri Aug 15 19:13:57 2003 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EE2A737B401; Fri, 15 Aug 2003 19:13:57 -0700 (PDT) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 508B243FE0; Fri, 15 Aug 2003 19:13:57 -0700 (PDT) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id 387D672DD4; Fri, 15 Aug 2003 19:13:57 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id 2D60172DD2; Fri, 15 Aug 2003 19:13:57 -0700 (PDT) Date: Fri, 15 Aug 2003 19:13:57 -0700 (PDT) From: Doug White To: Eugene Grosbein In-Reply-To: <20030815211321.A11482@grosbein.pp.ru> Message-ID: <20030815191010.S16351@carver.gumbysoft.com> References: <20030815211321.A11482@grosbein.pp.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: stable@freebsd.org cc: bug-followup@freebsd.org Subject: Re: bin/55346: /bin/sh eats memory and CPU infinitely X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2003 02:13:58 -0000 On Fri, 15 Aug 2003, Eugene Grosbein wrote: > I think I've found a memory leak in /bin/sh. > There is a case when dowait() and does frees resources of > completed job correctly. Here is a patch: Your idea has some merit but your patch does not conform to normal style. > -#if JOBS > if (done) > - deljob(jp); > -#endif > + freejob(jp); You should not remove the ifdef and change the indentation of deljob. Just s/del/free and be done with it :-) I highly doubt anyone needs to disable job control in sh, but in the off chance they do, you might as well keep the ifdef around. Note that freejob calls deljob. -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org