Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Aug 2003 19:20:09 -0700 (PDT)
From:      Doug White <dwhite@gumbysoft.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/55346: /bin/sh eats memory and CPU infinitely
Message-ID:  <200308160220.h7G2K9jQ054709@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: Doug White <dwhite@gumbysoft.com>
To: Eugene Grosbein <eugen@grosbein.pp.ru>
Cc: stable@freebsd.org, bug-followup@freebsd.org
Subject: Re: bin/55346: /bin/sh eats memory and CPU infinitely
Date: Fri, 15 Aug 2003 19:13:57 -0700 (PDT)

 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



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