From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, eblake@redhat.com, armbru@redhat.com,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH for-2.7 v4 00/36] Various memory leak fixes
Date: Fri, 5 Aug 2016 12:23:45 +0400 [thread overview]
Message-ID: <20160805082421.21994-1-marcandre.lureau@redhat.com> (raw)
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Hi,
Thanks to AddressSanitizer (ASAN), I found a number of direct leaks
worth fixing. Note that there are probably many indirect leaks left (I
am adding some here), I haven't investigated much yet.
There are still a number of direct leaks remaining, in particular in
the tests, but my libc doesn't give me good backtraces.
In order to easily switch to asan-enabled build, I make use of make
CFLAGS argument, which is why the first patch is also there.
v4:
- document qtest_add_data_func_full seperately
- add g_(s)list_free_full in glib-compat
- simplify tcp_chr_close()
- move dma_buf_commit() down before the early return case
- dropped a qdist leak patch already applied
v3:
- add glib<2.34 fallback for g_test_add_data_func_full() using
g_test_add_vtable() with an explicit comment
- add and use a tcp_chr_free_connection(), from tcp_chr_disconnect()
(suggested by Paolo)
- remove bad comment from "free MuxDriver" patch (Eric)
- replace GFunc casts with a qemu_g_func_free() inline (suggested by Eric)
- replace CFLAGS override patch with a toplevel CFLAGS filter
(suggested by Paolo)
- drop a patch already merged upstream
- update reviewed-by tags (28/36)
v2:
- split "pci-bus: do not allocate and leak bsel" as a seperate patch,
since the direct leak looks like a bug
- hook virtio_input_finalize to the abstract base class
- use mkdtemp in test-io-channel-command
- fix pc-cpu-test commit message
- move the sglist destruction inside of ncq_err, call dma_buf_commit
in ide_dma_cb, as suggested by John Snow
- fix build with glib 2.22
- add the given reviewed-by tags (22/37, 15 left)
Marc-André Lureau (36):
build-sys: fix building with make CFLAGS=.. argument
tests: fix test-qga leaks
glib-compat: add g_(s)list_free_full()
qga: free the whole blacklist
qga: free remaining leaking state
tests: fix test-cutils leaks
tests: fix test-vmstate leaks
tests: fix test-iov leaks
tests: fix check-qom-interface leaks
tests: fix check-qom-proplist leaks
tests: fix small leak in test-io-channel-command
tests: fix leak in test-string-input-visitor
portio: keep references on portio
numa: do not leak NumaOptions
pc: simplify passing qemu_irq
pc: don't leak a20_line
machine: use class base init generated name
acpi-build: fix array leak
char: free the tcp connection data when closing
char: free MuxDriver when closing
tests: fix qom-test leaks
pc: free i8259
pc: keep gsi reference
ahci: free irqs array
sd: free timer
qjson: free str
virtio-input: free config list
ipmi: free extern timer
usb: free USBDevice.strings
usb: free leaking path
bus: simplify name handling
tests: add qtest_add_data_func_full
tests: pc-cpu-test leaks fixes
tests: fix rsp leak in postcopy-test
ahci: fix sglist leak on retry
tests: fix postcopy-test leaks
Makefile | 3 +-
hw/audio/gus.c | 9 ++++--
hw/audio/sb16.c | 4 ++-
hw/block/fdc.c | 4 ++-
hw/char/parallel.c | 3 +-
hw/core/bus.c | 21 ++++----------
hw/core/machine.c | 1 +
hw/display/vga-isa.c | 8 ++++--
hw/dma/i8257.c | 6 ++--
hw/i386/acpi-build.c | 4 +--
hw/i386/pc.c | 9 +++---
hw/i386/pc_piix.c | 17 ++++++------
hw/i386/pc_q35.c | 15 +++++-----
hw/ide/ahci.c | 4 +--
hw/ide/core.c | 7 +++--
hw/input/pckbd.c | 4 +--
hw/input/virtio-input.c | 11 ++++++++
hw/ipmi/ipmi_bmc_extern.c | 9 ++++++
hw/isa/isa-bus.c | 14 ++++------
hw/sd/sd.c | 9 ++++++
hw/usb/bus.c | 7 +++++
hw/usb/desc.c | 1 +
include/glib-compat.h | 24 ++++++++++++++++
include/hw/boards.h | 2 +-
include/hw/i386/pc.h | 4 +--
include/hw/ide/internal.h | 2 ++
include/hw/isa/i8257.h | 2 ++
include/hw/isa/isa.h | 5 +++-
include/hw/qdev-core.h | 2 +-
migration/qjson.c | 1 +
numa.c | 15 +++++-----
pc-bios/optionrom/Makefile | 2 --
qemu-char.c | 58 ++++++++++++++++++++++++++-------------
qga/guest-agent-command-state.c | 6 ++++
qga/guest-agent-core.h | 1 +
qga/main.c | 13 +++++----
tests/check-qom-interface.c | 1 +
tests/check-qom-proplist.c | 16 +++++++++++
tests/libqtest.c | 15 ++++++++++
tests/libqtest.h | 17 ++++++++++++
tests/pc-cpu-test.c | 24 ++++++++++++----
tests/postcopy-test.c | 7 +++--
tests/qom-test.c | 5 ++--
tests/test-cutils.c | 24 ++++++++++------
tests/test-io-channel-command.c | 20 +++++++++-----
tests/test-iov.c | 7 +++++
tests/test-qga.c | 8 +++++-
tests/test-string-input-visitor.c | 1 +
tests/test-vmstate.c | 8 ++++--
49 files changed, 331 insertions(+), 129 deletions(-)
--
2.9.0
next reply other threads:[~2016-08-05 8:24 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 8:23 marcandre.lureau [this message]
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 01/36] build-sys: fix building with make CFLAGS=.. argument marcandre.lureau
2016-08-08 8:58 ` Paolo Bonzini
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 02/36] tests: fix test-qga leaks marcandre.lureau
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 03/36] glib-compat: add g_(s)list_free_full() marcandre.lureau
2016-08-05 11:25 ` Markus Armbruster
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 04/36] qga: free the whole blacklist marcandre.lureau
2016-08-05 11:25 ` Markus Armbruster
2016-08-05 16:57 ` Eric Blake
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 05/36] qga: free remaining leaking state marcandre.lureau
2016-08-05 11:26 ` Markus Armbruster
2016-08-05 16:56 ` Eric Blake
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 06/36] tests: fix test-cutils leaks marcandre.lureau
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 07/36] tests: fix test-vmstate leaks marcandre.lureau
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 08/36] tests: fix test-iov leaks marcandre.lureau
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 09/36] tests: fix check-qom-interface leaks marcandre.lureau
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 10/36] tests: fix check-qom-proplist leaks marcandre.lureau
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 11/36] tests: fix small leak in test-io-channel-command marcandre.lureau
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 12/36] tests: fix leak in test-string-input-visitor marcandre.lureau
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 13/36] portio: keep references on portio marcandre.lureau
2016-08-05 8:23 ` [Qemu-devel] [PATCH for-2.7 v4 14/36] numa: do not leak NumaOptions marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 15/36] pc: simplify passing qemu_irq marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 16/36] pc: don't leak a20_line marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 17/36] machine: use class base init generated name marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 18/36] acpi-build: fix array leak marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 19/36] char: free the tcp connection data when closing marcandre.lureau
2016-08-05 10:04 ` Paolo Bonzini
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 20/36] char: free MuxDriver " marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 21/36] tests: fix qom-test leaks marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 22/36] pc: free i8259 marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 23/36] pc: keep gsi reference marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 24/36] ahci: free irqs array marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 25/36] sd: free timer marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 26/36] qjson: free str marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 27/36] virtio-input: free config list marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 28/36] ipmi: free extern timer marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 29/36] usb: free USBDevice.strings marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 30/36] usb: free leaking path marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 31/36] bus: simplify name handling marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 32/36] tests: add qtest_add_data_func_full marcandre.lureau
2016-08-05 11:29 ` Markus Armbruster
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 33/36] tests: pc-cpu-test leaks fixes marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 34/36] tests: fix rsp leak in postcopy-test marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 35/36] ahci: fix sglist leak on retry marcandre.lureau
2016-08-05 8:24 ` [Qemu-devel] [PATCH for-2.7 v4 36/36] tests: fix postcopy-test leaks marcandre.lureau
2016-08-05 8:40 ` [Qemu-devel] [PATCH for-2.7 v4 00/36] Various memory leak fixes Daniel P. Berrange
2016-08-05 18:01 ` Marc-André Lureau
2016-08-07 19:15 ` Peter Maydell
2016-08-07 19:31 ` Marc-André Lureau
2016-08-07 19:38 ` 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=20160805082421.21994-1-marcandre.lureau@redhat.com \
--to=marcandre.lureau@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).