From owner-freebsd-stable Thu Jul 4 3:18:10 2002 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 F0C1837B400; Thu, 4 Jul 2002 03:18:06 -0700 (PDT) Received: from grosbein.pp.ru (www2.svzserv.kemerovo.su [213.184.65.86]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5F6743E3B; Thu, 4 Jul 2002 03:18:04 -0700 (PDT) (envelope-from eu@grosbein.pp.ru) Received: from grosbein.pp.ru (smmsp@localhost [127.0.0.1]) by grosbein.pp.ru (8.12.5/8.12.2) with ESMTP id g64AH8L5017186; Thu, 4 Jul 2002 18:17:08 +0800 (KRAST) (envelope-from eu@grosbein.pp.ru) Received: (from root@localhost) by grosbein.pp.ru (8.12.5/8.12.3/Submit) id g64AGhEF017182; Thu, 4 Jul 2002 18:16:43 +0800 (KRAST) Date: Thu, 4 Jul 2002 18:16:43 +0800 (KRAST) Message-Id: <200207041016.g64AGhEF017182@grosbein.pp.ru> To: FreeBSD-gnats-submit@freebsd.org Subject: /bin/sh with builtin 'test' has memory leaks From: Eugene Grosbein Reply-To: Eugene Grosbein Cc: stable@freebsd.org X-send-pr-version: 3.113 X-GNATS-Notify: Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >Submitter-Id: current-users >Originator: Eugene Grosbein >Organization: Svyaz Service JSC >Confidential: no >Synopsis: /bin/sh with builtin 'test' has memory leaks >Severity: serious >Priority: low >Category: bin >Class: sw-bug >Release: FreeBSD 4.6-STABLE i386 >Environment: System: All releases with test built in /bin/sh >Description: There seem to be memory leak in 'test' command that was not a problem when it was external command but it became a problem when 'test' was made builtin. >How-To-Repeat: 1. Make test.sh: #!/bin/sh while : do [ 1=1 ] done 2. run top in one session and 'nice ./test.sh' in another, see how quickly it leaks. >Fix: Unknown for me. There are workarounds, though: 1. alias test=/bin/test; alias [=/bin/[ This will force using standalone versions of test and attenuate the problem. 2. Rebuild /bin/sh without test as builtin. That's enough to delete last line from /usr/src/bin/sh/builtins.def To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message