Re: Memory growth observed with C++ application consuming libpq.dll on Windows

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rajesh Kokkonda <rajeshk(dot)kokkonda(at)gmail(dot)com>
Cc: Yasir <yasir(dot)hussain(dot)shah(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Memory growth observed with C++ application consuming libpq.dll on Windows
Date: 2024-08-02 13:53:16
Message-ID: 3964935.1722606796@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rajesh Kokkonda <rajeshk(dot)kokkonda(at)gmail(dot)com> writes:
> Are you looking for a fully functional sample program or only the APIs from
> libpq library that our product uses? I am asking this because if the
> requirement is to have a sample code, then I will have to work on creating
> one on the same lines as our product.

Just for the record, the last field-reported memory leak in libpq
was found/fixed in 2020, and it occurred only when using GSSAPI
encryption. Previous reports weren't frequent either. So while
it may be that you've found one, it seems far more likely that the
fault is in your application. In any case, nobody is likely to
spend time looking for a bug that may not be there unless you can
produce a self-contained test case demonstrating a leak.

If we had a test case, the first thing we'd likely do would be
to run it under Valgrind, to see if automated analysis is enough
to locate the logic fault. So an alternative you could consider
before trying to extract a test case is to run your app under
Valgrind for yourself. As a bonus, that has a decent shot at
locating the fault whether it's ours or yours. I'm not sure
if Valgrind is available for Windows though --- can you easily
put the app on a different platform?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-08-02 13:55:50 Re: Remove obsolete RECHECK keyword completely
Previous Message Jacob Champion 2024-08-02 13:48:00 Re: can we mark upper/lower/textlike functions leakproof?