From owner-freebsd-bugs Sat Oct 10 09:10:09 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA21644 for freebsd-bugs-outgoing; Sat, 10 Oct 1998 09:10: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 JAA21578 for ; Sat, 10 Oct 1998 09:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id JAA22077; Sat, 10 Oct 1998 09:10:01 -0700 (PDT) Date: Sat, 10 Oct 1998 09:10:01 -0700 (PDT) Message-Id: <199810101610.JAA22077@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: dag-erli@ifi.uio.no (Dag-Erling C. =?iso-8859-1?Q?Sm=F8rgrav?= ) Subject: Re: kern/8252: popen/pclose leaks Reply-To: dag-erli@ifi.uio.no (Dag-Erling C. =?iso-8859-1?Q?Sm=F8rgrav?= ) 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: dag-erli@ifi.uio.no (Dag-Erling C. =?iso-8859-1?Q?Sm=F8rgrav?= ) To: zerium@zerium.dyn.ml.org Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: kern/8252: popen/pclose leaks Date: 10 Oct 1998 18:02:59 +0200 zerium@webindex.no writes: > >Severity: critical > >Priority: high Hmm, are you sure this is appropriate? > A pclose() after a popen does not free all the uses memory. > > This is only a problem in v3.0, not in v2.2.x. > > The RCS diff between the popen.c in v2.2 and v3.0 is null, nil, no, > nothing. I'm not sure if the libc function calls leaks or if it's a kernel > problem. The leak is related to the use of vfork(). If you replace vfork() with fork() in src/lib/libc/gen/popen.c the bug will disappear. I have a feeling that calling execl() in the child branch of a vfork() might be a pretty bad idea, since execl() calls buildargv() which uses realloc() extensively. DES -- Dag-Erling Smørgrav - dag-erli@ifi.uio.no To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message