public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Aaron Merey <amerey@redhat.com>, "Frank Ch. Eigler" <fche@redhat.com>
Cc: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] debuginfod-support.c: Use long-lived debuginfod_client
Date: Thu, 6 May 2021 14:03:46 -0400	[thread overview]
Message-ID: <ff23e4dd-a85b-2db4-34e3-051bad1bcf85@polymtl.ca> (raw)
In-Reply-To: <CAJDtP-RJbn8-cCb-Ha2ExKKzoBVeLbt1v6cDX=tQf-uwqpar4A@mail.gmail.com>

On 2021-05-06 1:27 p.m., Aaron Merey via Gdb-patches wrote:
> On Wed, May 5, 2021 at 8:56 PM Frank Ch. Eigler via Gdb-patches
> <gdb-patches@sourceware.org> wrote:
>>> Will there ever be a need to finalize this object?  Like, shut it down
>>> cleanly in some way?
>>
>> Nope (except perhaps if running gdb under valgrind?).
> 
> Running gdb under valgrind appears to work properly and no
> debuginfod-related leaks are reported.
> 
> If there aren't any other concerns then I will merge this patch with
> Tom's suggestion to define global_client in debuginfod_init() included.

That might be because Valgrind does not show the memory that is still
allocated at program exit that is still reachable by a global variable.

I think it would still be a good idea to properly close the client at
exit.  Not because the memory leak is a concern, but because we
shouldn't assume what closing a debuginfod client (current or future)
does or does not do, so we shouldn't assume that we can get away without
calling debuginfo_end.   A debuginfod client could eventually maintain
some temporary files that need to be deleted when closing in order not
to litter /tmp, some cache files need to be flushed, etc.

Simon

  parent reply	other threads:[~2021-05-06 18:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30 23:57 Aaron Merey
2021-05-04 14:27 ` Tom Tromey
2021-05-06  0:55 ` Frank Ch. Eigler
2021-05-06 17:27   ` Aaron Merey
2021-05-06 17:39     ` Tom Tromey
2021-05-06 18:03     ` Simon Marchi [this message]
2021-05-06 18:47       ` Frank Ch. Eigler
2021-05-06 19:11         ` Simon Marchi
2021-05-06 20:35           ` Aaron Merey
2021-05-06 21:45             ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff23e4dd-a85b-2db4-34e3-051bad1bcf85@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=amerey@redhat.com \
    --cc=fche@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).