Received: from eggs.gnu.org ([2001:4830:134:3::10]:46335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPQna-0008In-T0 for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:54:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPQnU-0007PM-4w for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:54:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPQnT-0007PI-Sf for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:54:36 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B182C04B304 for ; Tue, 19 Jul 2016 08:54:35 +0000 (UTC) From: marcandre.lureau@redhat.com Date: Tue, 19 Jul 2016 12:53:55 +0400 Message-Id: <20160719085432.4572-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 00/37] Various memory leak fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau 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. The series is also available for convenience in https://github.com/elmarco/qemu leak branch. Marc-Andr=C3=A9 Lureau (37): build-sys: use an override for CFLAGS filter tests: fix test-qga leaks 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 qdist: fix entries memory leak 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: disconnect peer when qemu_chr_free() char: free MuxDriver when closing tests: fix qom-test leaks pc: free i8259 pci-bus: do not allocate and leak bsel 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 tests: free a bunch of qmp responses usb: free leaking path bus: simplify name handling tests: pc-cpu-test tests: fix rsp leak in postcopy-test ahci: fix sglist leak on retry tests: fix postcopy-test leaks 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 | 11 ++++------- hw/i386/pc.c | 9 +++++---- hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 3 +++ hw/ide/ahci.c | 3 +++ hw/ide/core.c | 6 ++++-- hw/input/pckbd.c | 4 ++-- hw/input/virtio-input-hid.c | 1 + hw/input/virtio-input.c | 10 ++++++++++ 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/hw/boards.h | 3 ++- include/hw/i386/pc.h | 3 +-- include/hw/ide/internal.h | 2 ++ include/hw/isa/i8257.h | 2 ++ include/hw/isa/isa.h | 5 ++++- include/hw/pci/pci_bus.h | 1 + include/hw/qdev-core.h | 2 +- include/hw/virtio/virtio-input.h | 1 + migration/qjson.c | 1 + numa.c | 15 ++++++++------- pc-bios/optionrom/Makefile | 4 ++-- qemu-char.c | 10 ++++++++++ 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/libqos/usb.c | 1 + tests/pc-cpu-test.c | 8 ++++++-- tests/postcopy-test.c | 9 ++++++--- tests/pvpanic-test.c | 1 + tests/qom-test.c | 5 +++-- tests/test-cutils.c | 24 ++++++++++++++++-------- tests/test-filter-mirror.c | 4 +++- tests/test-filter-redirector.c | 8 ++++++-- tests/test-io-channel-command.c | 3 ++- tests/test-iov.c | 7 +++++++ tests/test-qga.c | 5 +++++ tests/test-string-input-visitor.c | 1 + tests/test-vmstate.c | 8 ++++++-- tests/virtio-blk-test.c | 19 +++++++++++++------ tests/virtio-net-test.c | 10 +++++++--- util/qdist.c | 3 ++- 55 files changed, 246 insertions(+), 100 deletions(-) --=20 2.9.0