From owner-freebsd-bugs Sat Oct 10 08:00:09 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA14679 for freebsd-bugs-outgoing; Sat, 10 Oct 1998 08:00:09 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA14623 for ; Sat, 10 Oct 1998 08:00:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id IAA19320; Sat, 10 Oct 1998 08:00:02 -0700 (PDT) Date: Sat, 10 Oct 1998 08:00:02 -0700 (PDT) Message-Id: <199810101500.IAA19320@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Jonathan Lemon Subject: Re: kern/8252: popen/pclose leaks Reply-To: Jonathan Lemon Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/8252; it has been noted by GNATS. From: Jonathan Lemon To: zerium@zerium.dyn.ml.org Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: kern/8252: popen/pclose leaks Date: Sat, 10 Oct 1998 09:54:16 -0500 This is a problem in the interaction between vfork() and execl(). The new vfork semantics are such that the child uses the parent's address space, not COW. execl calls malloc() to build the correct argv vector to pass to execve. This malloc'ed area used to be thrown away after execve creates a new address space, but now hangs around in the parent's address space, creating a leak. Quick-n-dirty fix is to turn off fast vfork: sysctl -w kern.kern_vfork=0 A better fix would be to somehow release the malloc'd area on a call to execve(). -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message