From owner-freebsd-stable@FreeBSD.ORG Fri Mar 16 17:10:30 2012 Return-Path: Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 460471065670; Fri, 16 Mar 2012 17:10:30 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from asmtpout024.mac.com (asmtpout024.mac.com [17.148.16.99]) by mx1.freebsd.org (Postfix) with ESMTP id 29A3C8FC22; Fri, 16 Mar 2012 17:10:29 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from cswiger1.apple.com (unknown [17.209.4.71]) by asmtp024.mac.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPSA id <0M0Z00I8SMCTK370@asmtp024.mac.com>; Fri, 16 Mar 2012 10:10:06 -0700 (PDT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.6.7498,1.0.260,0.0.0000 definitions=2012-03-16_05:2012-03-16, 2012-03-15, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1012030000 definitions=main-1203160161 From: Chuck Swiger In-reply-to: <4F636FB0.3090305@FreeBSD.org> Date: Fri, 16 Mar 2012 10:10:04 -0700 Message-id: <1C76E9AC-2AAC-4719-AFF2-6BEFF5F3C96B@mac.com> References: <4F636FB0.3090305@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1084) Cc: "freebsd-stable@freebsd.org Mailing List" Subject: Re: FreeBSD 9.0: Valgrind leaks memory X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2012 17:10:30 -0000 On Mar 16, 2012, at 9:52 AM, Dimitry Andric wrote: > For some reason, since the original BSD 4.4 Lite Lib Sources, the stdio > files are only flushed, not closed, at exit. In practice, it will not > matter much, as the kernel will cleanup any left-overs when the process > dies. File descriptors get shared between parent and child processes...just because a child process terminates doesn't necessarily mean that you want to close everything. Well, if POSIX 2008's O_CLOEXEC becomes more popular, folks can control whether a descriptor gets inherited an open() time, rather than needing fcntl()'s FD_CLOEXEC and deal with possible race conditions (especially multithreaded programs)... Regards, -- -Chuck