From owner-freebsd-bugs Wed Nov 7 0:20:15 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 0443837B418 for ; Wed, 7 Nov 2001 00:20:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id fA78K1X12566; Wed, 7 Nov 2001 00:20:01 -0800 (PST) (envelope-from gnats) Date: Wed, 7 Nov 2001 00:20:01 -0800 (PST) Message-Id: <200111070820.fA78K1X12566@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Maxim Konovalov Subject: Re: bin/31533: /bin/sh memory leak (fwd) Reply-To: Maxim Konovalov Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/31533; it has been noted by GNATS. From: Maxim Konovalov To: freebsd-gnats-sumbit@freebsd.org Cc: Bob Bishop Subject: Re: bin/31533: /bin/sh memory leak (fwd) Date: Wed, 7 Nov 2001 11:06:20 +0300 (MSK) Just as follow up. >From maxim@macomnet.ru Wed Nov 7 11:03:46 2001 Date: Mon, 5 Nov 2001 23:12:21 +0300 (MSK) From: Maxim Konovalov To: Alfred Perlstein Cc: Bob Bishop , hackers@FreeBSD.ORG Subject: Re: Committer please Hello, On Mon, 5 Nov 2001, Alfred Perlstein wrote: > * Bob Bishop [011105 06:35] wrote: > > Hi, > > > > Would some kind committer please have a look at bin/31533: /bin/sh memory > > leak. There is a patch there which I believe is OK. Having a memory leak > > loose in the shell seems like a Bad Idea to me. TIA > > Understandable, things like this could be applied more quickly if > someone would take the time to explain what the delta does other > than fix the problem. Meaning, what is VTEXTFIXED, and what does > removing it change? OK, mea culpa. /usr/src/bin/sh/var.h:48 #define VTEXTFIXED 0x08 /* text is staticly allocated */ Afaiu it is used for internal variables names which are statically allocated in /usr/src/bin/sh/var.c:102. VTEXTFIXED prevents them from freing: /usr/src/bin/sh/var.c:319 if ((vp->flags & (VTEXTFIXED|VSTACK)) == 0) ckfree(vp->text); PWD and OLDPWD variables are not statical ones and should be reallocated every time when changed. - -maxim -- Maxim Konovalov, MAcomnet, Internet-Intranet Dept., system engineer phone: +7 (095) 796-9079, mailto: maxim@macomnet.ru To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message