From owner-freebsd-stable@FreeBSD.ORG Fri Aug 15 06:15:10 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 A7BFF37B401; Fri, 15 Aug 2003 06:15:10 -0700 (PDT) Received: from grosbein.pp.ru (D00015.dialonly.kemerovo.su [213.184.66.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F6B443F3F; Fri, 15 Aug 2003 06:15:07 -0700 (PDT) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (smmsp@localhost [127.0.0.1]) by grosbein.pp.ru (8.12.9/8.12.9) with ESMTP id h7FDF1in028526; Fri, 15 Aug 2003 21:15:01 +0800 (KRAST) (envelope-from eugen@grosbein.pp.ru) Received: (from eugen@localhost) by grosbein.pp.ru (8.12.9/8.12.9/Submit) id h7FDDL2p025217; Fri, 15 Aug 2003 21:13:21 +0800 (KRAST) Date: Fri, 15 Aug 2003 21:13:21 +0800 From: Eugene Grosbein To: stable@freebsd.org Message-ID: <20030815211321.A11482@grosbein.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i 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: Fri, 15 Aug 2003 13:15:11 -0000 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: Index: jobs.c =================================================================== RCS file: /home/ncvs/src/bin/sh/jobs.c,v retrieving revision 1.27.2.11 diff -u -r1.27.2.11 jobs.c --- jobs.c 22 Jul 2003 13:11:26 -0000 1.27.2.11 +++ jobs.c 15 Aug 2003 13:02:23 -0000 @@ -960,10 +960,8 @@ if (jp->state != state) { TRACE(("Job %d: changing state from %d to %d\n", jp - jobtab + 1, jp->state, state)); jp->state = state; -#if JOBS if (done) - deljob(jp); -#endif + freejob(jp); } } } Eugene Grosbein