Re: BUG #6672: Memory leaks in dumputils.c - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: BUG #6672: Memory leaks in dumputils.c
Date
Msg-id 1338851678.7854.22.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: BUG #6672: Memory leaks in dumputils.c  (Josh Kupershmidt <schmiddy@gmail.com>)
List pgsql-bugs
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.

pgsql-bugs by date:

Previous
From: Jeff Davis
Date:
Subject: Re: BUG #6669: unique index w/ multiple columns and NULLs
Next
From: Tom Lane
Date:
Subject: Re: Calling xlst_process with certain arguments causes server crash