From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Subject: Re: [RFA] Fix leaks when pruning inferiors.
Date: Thu, 05 Dec 2019 16:44:00 -0000 [thread overview]
Message-ID: <20191205094404.5490aae6@f31-4.lan> (raw)
In-Reply-To: <20191201155220.15971-1-philippe.waroquiers@skynet.be>
On Sun, 1 Dec 2019 16:52:20 +0100
Philippe Waroquiers <philippe.waroquiers@skynet.be> wrote:
> Valgrind detects various inferior related leaks, such as:
> ==31877== 5,530 (56 direct, 5,474 indirect) bytes in 1 blocks are definitely lost in loss record 7,131 of 7,355
> ==31877== at 0x4C2E18C: calloc (vg_replace_malloc.c:760)
> ==31877== by 0x23E580: xcalloc (alloc.c:100)
> ==31877== by 0x4794A9: xcnewvec<void*> (poison.h:158)
> ==31877== by 0x4794A9: registry_alloc_data(registry_data_registry*, registry_fields*) (registry.c:51)
> ==31877== by 0x3A537C: inferior_alloc_data (inferior.c:43)
> ==31877== by 0x3A537C: inferior::inferior(int) (inferior.c:92)
> ==31877== by 0x3A5426: add_inferior_silent(int) (inferior.c:98)
> ==31877== by 0x3A5530: add_inferior(int) (inferior.c:122)
> ...
>
> Origin of the leaks is in prune_inferiors: prune_inferiors is first removing
> the inferior to prune from the inferior list, then calls delete_inferior.
> But delete_inferior will only really destroy the inferior when it finds
> it into the inferior list.
> As delete_inferior is removing the inferior to delete from the inferior list,
> ensure prune_inferiors only calls delete_inferior, without touching the
> inferior list.
>
> gdb/ChangeLog
> YYYY-MM-DD Philippe Waroquiers <philippe.waroquiers@skynet.be>
> * inferior.c (prune_inferiors): Only call delete_inferior,
> Do not modify the inferior list.
Okay.
(Though I'd rather see a semicolon or a period in place of the comma in
the ChangeLog entry.)
Kevin
prev parent reply other threads:[~2019-12-05 16:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-01 15:52 Philippe Waroquiers
2019-12-05 16:42 ` Pedro Alves
2019-12-05 22:30 ` Philippe Waroquiers
2019-12-05 16:44 ` Kevin Buettner [this message]
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=20191205094404.5490aae6@f31-4.lan \
--to=kevinb@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=philippe.waroquiers@skynet.be \
/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