pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #17184: When using openssl, the memory of a static variable is not freed in libpq
5+ messages / 5 participants
[nested] [flat]

* BUG #17184: When using openssl, the memory of a static variable is not freed in libpq
@ 2021-09-08 07:21 PG Bug reporting form <noreply@postgresql.org>
  2021-09-08 13:35 ` Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: PG Bug reporting form @ 2021-09-08 07:21 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: kaegoorn48@gmail.com

The following bug has been logged on the website:

Bug reference:      17184
Logged by:          Alexander Dzyuba
Email address:      kaegoorn48@gmail.com
PostgreSQL version: 12.8
Operating system:   Linux
Description:        

Valgrind shows static variable memory is not freed when using openssl 

libpq/fe-secure-openssl.c:1571

static BIO_METHOD *my_bio_methods;

Please add a method that will free memory after use



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

* Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq
  2021-09-08 07:21 BUG #17184: When using openssl, the memory of a static variable is not freed in libpq PG Bug reporting form <noreply@postgresql.org>
@ 2021-09-08 13:35 ` Tom Lane <tgl@sss.pgh.pa.us>
  2021-09-09 05:32   ` Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq Alexander Dzuba <kaegoorn48@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2021-09-08 13:35 UTC (permalink / raw)
  To: kaegoorn48@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org

PG Bug reporting form <noreply@postgresql.org> writes:
> Valgrind shows static variable memory is not freed when using openssl 
> libpq/fe-secure-openssl.c:1571
> static BIO_METHOD *my_bio_methods;

> Please add a method that will free memory after use

Why?  It's not leaked: the struct is still available for use
in future connection attempts.

			regards, tom lane





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

* Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq
  2021-09-08 07:21 BUG #17184: When using openssl, the memory of a static variable is not freed in libpq PG Bug reporting form <noreply@postgresql.org>
  2021-09-08 13:35 ` Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq Tom Lane <tgl@sss.pgh.pa.us>
@ 2021-09-09 05:32   ` Alexander Dzuba <kaegoorn48@gmail.com>
  2021-09-10 02:12     ` Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 5+ messages in thread

From: Alexander Dzuba @ 2021-09-09 05:32 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org

I know that this is not the real leak, but memcheck analysis shows that the
memory was not released. Because of this, CI tests fail and deploy is
blocked.

ср, 8 сент. 2021 г. в 16:35, Tom Lane <tgl@sss.pgh.pa.us>:

> PG Bug reporting form <noreply@postgresql.org> writes:
> > Valgrind shows static variable memory is not freed when using openssl
> > libpq/fe-secure-openssl.c:1571
> > static BIO_METHOD *my_bio_methods;
>
> > Please add a method that will free memory after use
>
> Why?  It's not leaked: the struct is still available for use
> in future connection attempts.
>
>                         regards, tom lane
>

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

* Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq
  2021-09-08 07:21 BUG #17184: When using openssl, the memory of a static variable is not freed in libpq PG Bug reporting form <noreply@postgresql.org>
  2021-09-08 13:35 ` Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq Tom Lane <tgl@sss.pgh.pa.us>
  2021-09-09 05:32   ` Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq Alexander Dzuba <kaegoorn48@gmail.com>
@ 2021-09-10 02:12     ` Michael Paquier <michael@paquier.xyz>
  2021-09-13 02:59       ` Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq Kyotaro Horiguchi <horikyota.ntt@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Michael Paquier @ 2021-09-10 02:12 UTC (permalink / raw)
  To: Alexander Dzuba <kaegoorn48@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org

On Thu, Sep 09, 2021 at 08:32:58AM +0300, Alexander Dzuba wrote:
> I know that this is not the real leak, but memcheck analysis shows that the
> memory was not released. Because of this, CI tests fail and deploy is
> blocked.

Perhaps there is room for improvement in valgrind.supp then?
--
Michael

Attachments:

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

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

* Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq
  2021-09-08 07:21 BUG #17184: When using openssl, the memory of a static variable is not freed in libpq PG Bug reporting form <noreply@postgresql.org>
  2021-09-08 13:35 ` Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq Tom Lane <tgl@sss.pgh.pa.us>
  2021-09-09 05:32   ` Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq Alexander Dzuba <kaegoorn48@gmail.com>
  2021-09-10 02:12     ` Re: BUG #17184: When using openssl, the memory of a static variable is not freed in libpq Michael Paquier <michael@paquier.xyz>
@ 2021-09-13 02:59       ` Kyotaro Horiguchi <horikyota.ntt@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Kyotaro Horiguchi @ 2021-09-13 02:59 UTC (permalink / raw)
  To: michael@paquier.xyz; +Cc: kaegoorn48@gmail.com; tgl@sss.pgh.pa.us; pgsql-bugs@lists.postgresql.org

At Fri, 10 Sep 2021 11:12:21 +0900, Michael Paquier <michael@paquier.xyz> wrote in 
> On Thu, Sep 09, 2021 at 08:32:58AM +0300, Alexander Dzuba wrote:
> > I know that this is not the real leak, but memcheck analysis shows that the
> > memory was not released. Because of this, CI tests fail and deploy is
> > blocked.
> 
> Perhaps there is room for improvement in valgrind.supp then?

If I specified '--leak-check=full --show-leak-kinds=reachable' (or
'all') for psql, I see many other complaints for the other than the
my_BIO_s_socket.  And I saw two errors in my_BIO_s_socket.

So even if I tried to silence valgrind about the errors by inserting
something like the below into the file, still there are many other
errors.

{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   match-leak-kinds: reachable
   fun:malloc
   ...
   fun:initialize_SSL
}

The following beats out all reachable errors come from malloc, realloc
and calloc (and any other *alloc's:p) but I don't think this is what
we want here...

{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   match-leak-kinds: reachable
   fun:*alloc
}

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center





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


end of thread, other threads:[~2021-09-13 02:59 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 07:21 BUG #17184: When using openssl, the memory of a static variable is not freed in libpq PG Bug reporting form <noreply@postgresql.org>
2021-09-08 13:35 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-09-09 05:32   ` Alexander Dzuba <kaegoorn48@gmail.com>
2021-09-10 02:12     ` Michael Paquier <michael@paquier.xyz>
2021-09-13 02:59       ` Kyotaro Horiguchi <horikyota.ntt@gmail.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