From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11573 invoked by alias); 28 Oct 2008 14:20:42 -0000 Received: (qmail 11563 invoked by uid 22791); 28 Oct 2008 14:20:42 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 28 Oct 2008 14:20:02 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 9C2C510596; Tue, 28 Oct 2008 14:20:00 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 75F3D10595; Tue, 28 Oct 2008 14:20:00 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KupQO-0005oV-3m; Tue, 28 Oct 2008 10:20:00 -0400 Date: Tue, 28 Oct 2008 16:25:00 -0000 From: Daniel Jacobowitz To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFA: fix fopen related cleanups Message-ID: <20081028142000.GA22331@caradoc.them.org> Mail-Followup-To: Tom Tromey , gdb-patches@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00676.txt.bz2 On Mon, Oct 27, 2008 at 07:27:43PM -0600, Tom Tromey wrote: > While looking into another issue, I noticed a number of fopen-related > buglets in gdb. In particular, there are several places in gdb where > a file is not properly closed if an error occurs. > > This patch fixes all the fopen-related problems. It also fixes a > couple memory leaks I noticed while writing this. Finally, it > consolidates all the implementations of make_cleanup_fclose, explicit > or implicit, into a single place. > > I think there are also some file-close-related flaws having to do with > open (procfs_pidlist -- this function is flawed in a few ways) and > also gdb_fopen (instances in dummy-frame.c, regcache.c, and > reggroups.c according to my notes). I haven't yet checked opendir, > socket, or pipe. I will deal with those in separate patches. > > Built and regtested on x86-64 (compile farm). > Of course, this does not show whether the bug is fixed or not. > For that I relied on inspection. > > Please review. Looks OK to me. -- Daniel Jacobowitz CodeSourcery