Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Aug 2003 06:20:14 -0700 (PDT)
From:      Eugene Grosbein <eugen@grosbein.pp.ru>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/55346: /bin/sh eats memory and CPU infinitely
Message-ID:  <200308151320.h7FDKEXq085188@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/55346; it has been noted by GNATS.

From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: stable@freebsd.org
Cc: bug-followup@freebsd.org
Subject: Re: bin/55346: /bin/sh eats memory and CPU infinitely
Date: Fri, 15 Aug 2003 21:13:21 +0800

 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308151320.h7FDKEXq085188>