Re: [PATCH] ecpg: fix progname memory leak

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Meskes <meskes(at)postgresql(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: [PATCH] ecpg: fix progname memory leak
Date: 2020-10-09 00:19:50
Message-ID: 20201009001950.GB1528@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 08, 2020 at 01:17:25PM -0400, Tom Lane wrote:
> Agreed. In theory there might be some point in removing leaks that happen
> per-statement, so as to avoid unreasonable memory bloat when processing an
> extremely long input file. In practice nobody has complained about that,
> and if somebody did I'd probably question the sanity of putting so much
> code into one file. (The C compiler would likely bloat even more while
> processing the output...) Moreover, given the way the ecpg grammar works,
> it'd be really painful to avoid all such leaks, and it might well
> introduce bugs not fix them.

I got to wonder about that, and I don't quite see how to make all the
memory handling clean without having at least a concept of
per-statement memory context to make any cleanup easy once a statement
is done. That's a lot of infrastructure for a case nobody really
complained about, indeed..

> In any case, if this TODO item is going to lead to ideas as dubious
> as "let's free progname before exiting", it's not helpful.

+1. Agreed to just remove it.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2020-10-09 00:36:18 Re: Assertion failure with LEFT JOINs among >500 relations
Previous Message Peter Smith 2020-10-09 00:14:24 Re: [HACKERS] logical decoding of two-phase transactions