pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Memory leakage in libpq valgrind test
4+ messages / 3 participants
[nested] [flat]

* Memory leakage in libpq valgrind test
@ 2023-03-01 06:34  Sudheer H R <sudheer.hr@tekenlight.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Sudheer H R @ 2023-03-01 06:34 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org

Hello,

I am using libpq (version 5.12) for connecting to Postgresql 12.8.

While running valgrind to detect memory leaks, found the following as one of the leaks.
Request you to comment on this.

Regards,
Sudheer


==4938== 153 (48 direct, 105 indirect) bytes in 1 blocks are definitely lost in loss record 30 of 42
==4938==    at 0x4849D8C: malloc (in /usr/lib/aarch64-linux-gnu/valgrind/vgpreload_memcheck-arm64-linux.so)
==4938==    by 0xB31173B: krb5int_setspecific (in /usr/lib/aarch64-linux-gnu/libkrb5support.so.0.1)
==4938==    by 0xB13AA5B: ??? (in /usr/lib/aarch64-linux-gnu/libgssapi_krb5.so.2.2)
==4938==    by 0xB13AB33: ??? (in /usr/lib/aarch64-linux-gnu/libgssapi_krb5.so.2.2)
==4938==    by 0xB13AC73: ??? (in /usr/lib/aarch64-linux-gnu/libgssapi_krb5.so.2.2)
==4938==    by 0xB1395D7: ??? (in /usr/lib/aarch64-linux-gnu/libgssapi_krb5.so.2.2)
==4938==    by 0xB13A18B: ??? (in /usr/lib/aarch64-linux-gnu/libgssapi_krb5.so.2.2)
==4938==    by 0xB1290EB: gss_add_cred_from (in /usr/lib/aarch64-linux-gnu/libgssapi_krb5.so.2.2)
==4938==    by 0xB129577: gss_acquire_cred_from (in /usr/lib/aarch64-linux-gnu/libgssapi_krb5.so.2.2)
==4938==    by 0xB129787: gss_acquire_cred (in /usr/lib/aarch64-linux-gnu/libgssapi_krb5.so.2.2)
==4938==    by 0xB0E00DF: ??? (in /usr/lib/aarch64-linux-gnu/libpq.so.5.12)
==4938==    by 0xB0CC1D3: PQconnectPoll (in /usr/lib/aarch64-linux-gnu/libpq.so.5.12)







^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Memory leakage in libpq valgrind test
@ 2023-03-01 06:43  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Sudheer H R <sudheer.hr@tekenlight.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2023-03-01 06:43 UTC (permalink / raw)
  To: Sudheer H R <sudheer.hr@tekenlight.com>; +Cc: pgsql-bugs@lists.postgresql.org

Sudheer H R <sudheer.hr@tekenlight.com> writes:
> While running valgrind to detect memory leaks, found the following as one of the leaks.
> Request you to comment on this.

So ... why do you think this is our bug, and not a Kerberos bug?
The leak seems to be buried quite far in libgssapi_krb5.so.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Memory leakage in libpq valgrind test
@ 2023-03-01 06:59  Michael Paquier <michael@paquier.xyz>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Michael Paquier @ 2023-03-01 06:59 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Sudheer H R <sudheer.hr@tekenlight.com>; pgsql-bugs@lists.postgresql.org

On Wed, Mar 01, 2023 at 01:43:50AM -0500, Tom Lane wrote:
> So ... why do you think this is our bug, and not a Kerberos bug?
> The leak seems to be buried quite far in libgssapi_krb5.so.

Yeah, libpq calls gss_acquire_cred().  So, assuming that the leak is
localized within one of the resources allocated by this call, there is
nothing in the kerberos docs that point to a routine to free it:
https://web.mit.edu/kerberos/krb5-latest/doc/appdev/gssapi.html or
gssapi.rst in its code tree.

I may be missing something, of course.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Memory leakage in libpq valgrind test
@ 2023-03-01 07:05  Sudheer H R <sudheer.hr@tekenlight.com>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 4+ messages in thread

From: Sudheer H R @ 2023-03-01 07:05 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org

OK….

I am looking for links where I can raise an issue with libgssapi_krb5 team.
Would any of you know an appropriate link to raise the issue.

I am doing the test on ubuntu linux and on aarch64 (ARM 64)

Sudheer


> On 01-Mar-2023, at 12:29 PM, Michael Paquier <michael@paquier.xyz> wrote:
> 
> On Wed, Mar 01, 2023 at 01:43:50AM -0500, Tom Lane wrote:
>> So ... why do you think this is our bug, and not a Kerberos bug?
>> The leak seems to be buried quite far in libgssapi_krb5.so.
> 
> Yeah, libpq calls gss_acquire_cred().  So, assuming that the leak is
> localized within one of the resources allocated by this call, there is
> nothing in the kerberos docs that point to a routine to free it:
> https://web.mit.edu/kerberos/krb5-latest/doc/appdev/gssapi.html or
> gssapi.rst in its code tree.
> 
> I may be missing something, of course.
> --
> Michael






^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2023-03-01 07:05 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 06:34 Memory leakage in libpq valgrind test Sudheer H R <sudheer.hr@tekenlight.com>
2023-03-01 06:43 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-03-01 06:59   ` Michael Paquier <michael@paquier.xyz>
2023-03-01 07:05     ` Sudheer H R <sudheer.hr@tekenlight.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox