Re: Memory leak fix in psql

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Memory leak fix in psql
Date: 2022-07-21 06:23:45
Message-ID: 20220721062345.v775p3z7nzyldfi4@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Jul-21, Japin Li wrote:

> On Thu, 21 Jul 2022 at 09:48, Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> > We are talking about 256 bytes being leaked in each loop when a
> > validation pattern or when a query fails, so I don't see a strong
> > argument in manipulating 10~14 more than necessary for this amount of
> > memory. The contents of describe.c are the same for v15 though, and
> > we are still in beta on REL_15_STABLE, so I have applied the patch
> > down to v15, adding what Alvaro has sent on top of the rest.
>
> Thanks for the explanation! IMO, we could ignore v10-13 branches, however,
> we should backpatch to v14 which also uses the validateSQLNamePattern()
> function leading to a memory leak.

I'd agree in principle, but in practice the commit from 15 does not apply
cleanly on 14 -- there's a ton of conflicts.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Here's a general engineering tip: if the non-fun part is too complex for you
to figure out, that might indicate the fun part is too ambitious." (John Naylor)
https://postgr.es/m/CAFBsxsG4OWHBbSDM%3DsSeXrQGOtkPiOEOuME4yD7Ce41NtaAD9g%40mail.gmail.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2022-07-21 06:43:03 Re: Memory leak fix in psql
Previous Message Michael Paquier 2022-07-21 06:23:37 Re: Collect ObjectAddress for ATTACH DETACH PARTITION to use in event trigger