From owner-freebsd-questions@FreeBSD.ORG Tue Sep 22 11:42:34 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7644B10656AD for ; Tue, 22 Sep 2009 11:42:34 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 22FBB8FC18 for ; Tue, 22 Sep 2009 11:42:33 +0000 (UTC) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 2B5D3EB4F0E; Tue, 22 Sep 2009 14:42:33 +0300 (EEST) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 1A1234512A; Tue, 22 Sep 2009 14:42:33 +0300 (EEST) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id krMe271Kc5pB; Tue, 22 Sep 2009 14:42:33 +0300 (EEST) Received: from kobe.laptop (adsl78-142.kln.forthnet.gr [77.49.125.142]) by mail.ceid.upatras.gr (Postfix) with ESMTP id CED0B450C6; Tue, 22 Sep 2009 14:42:32 +0300 (EEST) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n8MBgVhR091490 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Sep 2009 14:42:31 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n8MBgUlN091489; Tue, 22 Sep 2009 14:42:30 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Modulok References: <64c038660909220343w3ae0607bq8aad1c370ebf00aa@mail.gmail.com> Date: Tue, 22 Sep 2009 14:42:30 +0300 In-Reply-To: <64c038660909220343w3ae0607bq8aad1c370ebf00aa@mail.gmail.com> (modulok@gmail.com's message of "Tue, 22 Sep 2009 04:43:57 -0600") Message-ID: <878wg7tdcp.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: FreeBSD Questions Subject: Re: Is this a kernel memory leak or a process memory leak? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 11:42:34 -0000 On Tue, 22 Sep 2009 04:43:57 -0600, Modulok wrote: > Maybe I'm just not that bright, but I have a question regarding the following: > > man 3 getenv > > "Successive calls to setenv() or putenv() assigning a differently sized > value to the same name will result in a memory leak. The FreeBSD seman- > tics for these functions (namely, that the contents of value are copied > and that old values remain accessible indefinitely) make this bug > unavoidable. Future versions may eliminate one or both of these semantic > guarantees in order to fix the bug." > > > This is a memory leak within the process which calls sentenv() or > putenv(), not a memory leak in the kernel, right? Yes, it's a userland leak.