qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Cc: qemu-devel@nongnu.org,
	"Alex Williamson" <alex.williamson@redhat.com>,
	"Cédric Le Goater" <clg@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Peter Xu" <peterx@redhat.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Helge Deller" <deller@gmx.de>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"John Snow" <jsnow@redhat.com>,
	qemu-block@nongnu.org, "Keith Busch" <kbusch@kernel.org>,
	"Klaus Jensen" <its@irrelevant.dk>,
	"Jesper Devantier" <foss@defmacro.it>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
	qemu-ppc@nongnu.org, "John Levon" <john.levon@nutanix.com>,
	"Thanos Makatos" <thanos.makatos@nutanix.com>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"BALATON Zoltan" <balaton@eik.bme.hu>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Alexey Kardashevskiy" <aik@ozlabs.ru>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Thomas Huth" <thuth@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>
Subject: Re: [PATCH 00/16] memory: Stop piggybacking on memory region owners
Date: Mon, 1 Sep 2025 13:47:01 +0100	[thread overview]
Message-ID: <CAFEAcA8FhKBXJcOYaCTcsewzt+gBhy4Sqkznf1=vf+g-69901g@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA89xRp51q2T4M3R=pOuHcGE9zJCGDpbXOz4cBhxrcU00Q@mail.gmail.com>

On Mon, 1 Sept 2025 at 13:35, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Mon, 1 Sept 2025 at 07:11, Akihiko Odaki
> <odaki@rsg.ci.i.u-tokyo.ac.jp> wrote:
> >
> > Supersedes: https://lore.kernel.org/qemu-devel/20250828-san-v9-0-c0dff4b8a487@rsg.ci.i.u-tokyo.ac.jp/
> > ("[PATCH v9 0/2] Fix check-qtest-ppc64 sanitizer errors")
> >
> > MemoryRegions used to "piggyback" on their owners instead of using their
> > reference counters due to the circular dependencies between them, which
> > caused memory leak.
> >
> > I tried to fix it with "[PATCH v9 0/2] Fix check-qtest-ppc64 sanitizer
> > errors" but it resulted in a lengthy discussion; ultimately it is
> > attributed to the fact that "piggybacking" is hard to understand and
> > forces us design trade-offs. It was also insufficient because it only
> > deals with the container-subregion pattern and did not deal with DMA.
>
> Unlike Peter Xu's proposed patch and your v9 patch you reference
> above, with this series I still see leaks doing a 'make check'
> on an ASAN build of the Arm targets. Here's a sample leak
> detected during the device-introspect-test:

I should mention that I'm using an lsan-suppressions.txt file
with the following entries:

# This is a set of suppressions for LeakSanitizer; you can use it
# by setting
#   LSAN_OPTIONS="suppressions=/path/to/scripts/lsan-suppressions.txt"
# register_init_block API is busted
leak:register_init_block
leak:canfd_populate_regarray
# qtest-only leak, not very important
leak:qemu_irq_intercept_in
# this is maybe a leak caused by g_test_trap_subprocess():
# in the subprocess, the cleanup functions that are supposed to free
# memory don't get run for some reason.
leak:qos_traverse_graph

plus various leak fixes which I've sent out over the past week or two:

[PATCH 0/3] hw: Fix qemu_init_irq() leaks
 https://patchew.org/QEMU/20250821154053.2417090-1-peter.maydell@linaro.org/

[PATCH] hw/char/max78000_uart: Destroy FIFO on deinit
https://patchew.org/QEMU/20250821154358.2417744-1-peter.maydell@linaro.org/

[PATCH] hw/gpio/pca9554: Avoid leak in pca9554_set_pin()
https://patchew.org/QEMU/20250821154459.2417976-1-peter.maydell@linaro.org/

[PATCH 0/2] hw: fix some leaks in xlnx devices
https://patchew.org/QEMU/20250826174956.3010274-1-peter.maydell@linaro.org/

[PATCH] hw/arm/boot: Correctly free the MemoryDeviceInfoList
https://patchew.org/QEMU/20250901102214.3748011-1-peter.maydell@linaro.org/

and with those patches plus the lsan-suppressions file plus either
Peter Xu's patch or your v9 patch I get a clean 'make check' run.

thanks
-- PMM


  reply	other threads:[~2025-09-01 12:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01  6:09 [PATCH 00/16] memory: Stop piggybacking on memory region owners Akihiko Odaki
2025-09-01  6:09 ` [PATCH 01/16] docs/devel: Do not unparent in instance_finalize Akihiko Odaki
2025-09-01  6:10 ` [PATCH 02/16] vfio/pci: " Akihiko Odaki
2025-09-01 11:51   ` Cédric Le Goater
2025-09-01  6:10 ` [PATCH 03/16] qdev: Automatically delete memory subregions Akihiko Odaki
2025-09-01  6:10 ` [PATCH 04/16] hw/char/diva-gsp: Do not delete the subregion Akihiko Odaki
2025-09-01  6:10 ` [PATCH 05/16] hw/char/serial-pci-multi: " Akihiko Odaki
2025-09-01  6:10 ` [PATCH 06/16] secondary-vga: Do not delete the subregions Akihiko Odaki
2025-09-01  6:10 ` [PATCH 07/16] cmd646: " Akihiko Odaki
2025-09-01  6:10 ` [PATCH 08/16] hw/ide/piix: " Akihiko Odaki
2025-09-01  6:10 ` [PATCH 09/16] hw/ide/via: " Akihiko Odaki
2025-09-01  6:10 ` [PATCH 10/16] hw/nvme: Do not delete the subregion Akihiko Odaki
2025-09-01  6:10 ` [PATCH 11/16] pci: Do not delete the subregions Akihiko Odaki
2025-09-01  6:10 ` [PATCH 12/16] hw/ppc/spapr_pci: " Akihiko Odaki
2025-09-01  6:10 ` [PATCH 13/16] hw/usb/hcd-ehci: " Akihiko Odaki
2025-09-01  6:10 ` [PATCH 14/16] hw/usb/hcd-xhci: " Akihiko Odaki
2025-09-01  6:10 ` [PATCH 15/16] vfio-user: Do not delete the subregion Akihiko Odaki
2025-09-01  6:10 ` [PATCH 16/16] memory: Stop piggybacking on memory region owners Akihiko Odaki
2025-09-01 12:35 ` [PATCH 00/16] " Peter Maydell
2025-09-01 12:47   ` Peter Maydell [this message]
2025-09-01 13:27   ` Akihiko Odaki
2025-09-01 13:42     ` Peter Maydell

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='CAFEAcA8FhKBXJcOYaCTcsewzt+gBhy4Sqkznf1=vf+g-69901g@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=aik@ozlabs.ru \
    --cc=alex.bennee@linaro.org \
    --cc=alex.williamson@redhat.com \
    --cc=balaton@eik.bme.hu \
    --cc=berrange@redhat.com \
    --cc=clg@redhat.com \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=david@redhat.com \
    --cc=deller@gmx.de \
    --cc=eduardo@habkost.net \
    --cc=farosas@suse.de \
    --cc=foss@defmacro.it \
    --cc=harshpb@linux.ibm.com \
    --cc=its@irrelevant.dk \
    --cc=jiaxun.yang@flygoat.com \
    --cc=john.levon@nutanix.com \
    --cc=jsnow@redhat.com \
    --cc=kbusch@kernel.org \
    --cc=kraxel@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thanos.makatos@nutanix.com \
    --cc=thuth@redhat.com \
    --cc=wangyanan55@huawei.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 NNTP newsgroup(s).