From owner-freebsd-hackers Mon Nov 5 12:12:49 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from relay1.macomnet.ru (relay1.macomnet.ru [195.128.64.10]) by hub.freebsd.org (Postfix) with ESMTP id 277F737B416 for ; Mon, 5 Nov 2001 12:12:43 -0800 (PST) Received: from news1.macomnet.ru (maxim@news1.macomnet.ru [195.128.64.14]) by relay1.macomnet.ru (8.11.3/8.11.3) with ESMTP id fA5KCLb2177884; Mon, 5 Nov 2001 23:12:22 +0300 (MSK) Date: Mon, 5 Nov 2001 23:12:21 +0300 (MSK) From: Maxim Konovalov To: Alfred Perlstein Cc: Bob Bishop , Subject: Re: Committer please In-Reply-To: <20011105130328.G89342@elvis.mu.org> Message-ID: <20011105223436.K7338-100000@news1.macomnet.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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-hackers" in the body of the message