Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id E4376C955BD for ; Mon, 4 Jun 2012 20:14:59 -0300 (ADT) Received: from mailout-de.gmx.net ([213.165.64.23]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1SbgUC-0000Gh-Ma for pgsql-bugs@postgresql.org; Mon, 04 Jun 2012 23:14:58 +0000 Received: (qmail invoked by alias); 04 Jun 2012 23:14:42 -0000 Received: from a88-115-214-103.elisa-laajakaista.fi (EHLO [10.0.0.104]) [88.115.214.103] by mail.gmx.net (mp019) with SMTP; 05 Jun 2012 01:14:42 +0200 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX18BkMEBKVoBvG7JbhTVbSzP4ag+AIOzOyJuDmKMB4 Lfdlh9GMfyu9Zn Message-ID: <1338851678.7854.22.camel@vanquo.pezone.net> Subject: Re: BUG #6672: Memory leaks in dumputils.c From: Peter Eisentraut To: Josh Kupershmidt Cc: Anna Zaks , Tom Lane , pgsql-bugs@postgresql.org Date: Tue, 05 Jun 2012 02:14:38 +0300 In-Reply-To: References: <2620.1338527206@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.2-1 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-Y-GMX-Trusted: 0 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/29 X-Sequence-Number: 33256 On fre, 2012-06-01 at 21:26 -0700, Josh Kupershmidt wrote: > It's too bad the clang > doesn't understand our ereport(ERROR, ...) calls don't return to the > caller, as those seem to account for a fair bit of the spurious > warnings. I haven't seen anything which I'd call an outright bug, > though there are e.g. non-kosher uses of malloc() which could > certainly be improved. > > Hrm, I wonder if proc_exit() and ExitPostmaster() could be declared > with __attribute__((noreturn)) , that seems like it would quiet a few > errors. I have a few in-progress patches for this that I didn't finish for 9.2. (Some noreturn bits already went into 9.2.) proc_exit() and ExitPostmaster() are low-hanging fruit, but then there is the whole PostgresMain(), PostmasterMain(), GucInfoMain(), WalSenderMain() line of functions (for which I have a patch), then the elog/ereport issue (for which I have a patch, but it could be controversial), and then the Assert() issue (which seems more difficult to solve, because you can turn off assertions at run time, so you can't guarantee anything to the compiler). I will rebase and submit what I have for the next commitfest.