On Mon, 1 Sept 2025 at 13:35, Peter Maydell <peter.mayd...@linaro.org> wrote: > > On Mon, 1 Sept 2025 at 07:11, Akihiko Odaki > <od...@rsg.ci.i.u-tokyo.ac.jp> wrote: > > > > Supersedes: > > https://lore.kernel.org/qemu-devel/20250828-san-v9-0-c0dff4b8a...@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.mayd...@linaro.org/ [PATCH] hw/char/max78000_uart: Destroy FIFO on deinit https://patchew.org/QEMU/20250821154358.2417744-1-peter.mayd...@linaro.org/ [PATCH] hw/gpio/pca9554: Avoid leak in pca9554_set_pin() https://patchew.org/QEMU/20250821154459.2417976-1-peter.mayd...@linaro.org/ [PATCH 0/2] hw: fix some leaks in xlnx devices https://patchew.org/QEMU/20250826174956.3010274-1-peter.mayd...@linaro.org/ [PATCH] hw/arm/boot: Correctly free the MemoryDeviceInfoList https://patchew.org/QEMU/20250901102214.3748011-1-peter.mayd...@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