From: Ian Campbell Subject: Re: Possible memory leak in qemu-dm (qemu-dm swapping 20GB+, adding 2gb+ per day) Date: Wed, 26 Mar 2014 08:57:03 +0000 Message-ID: <1395824223.29683.20.camel@dagon.hellion.org.uk> References: <5330E500.6020906@crc.id.au> <20140325070913.GC3200@reaktio.net> <1395743334.6294.37.camel@kazak.uk.xensource.com> <53315EE5.7050803@crc.id.au> <1395745431.6294.46.camel@kazak.uk.xensource.com> <533165A3.20605@citrix.com> <5332646C.4040905@crc.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <5332646C.4040905@crc.id.au> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Steven Haigh Cc: Andrew Cooper , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2014-03-26 at 16:23 +1100, Steven Haigh wrote: > Valgrind log available here: > http://xen.crc.id.au/bugs/view.php?id=3D25 Thanks. Before we go any further, can you confirm that you have this commit in your qemu-xen-traditional tree: commit 96b58a44756a8821c108358439b0f2c06e531159 Author: Matthew Daley Date: Wed Dec 4 15:16:18 2013 +1300 = xen_disk: fix memory leak = On ioreq_release the full ioreq was memset to 0, losing all the= data and memory allocations inside the QEMUIOVector, which leads to a memory leak. Create a new function to specifically reset ioreq. = Reported-by: Maik Wessler Signed-off-by: Roger Pau Monn=E9 Signed-off-by: Stefano Stabellini = Backport to qemu-xen-traditional. = Signed-off-by: Matthew Daley Acked-by: Ian Jackson = > Do you have any further suggestions / ideas based on this? Unfortunately the qemu-dm binary seems to have been stripped, which removes much of the useful info from the traces. Please can you make sure you have the following commit to the qemu-xen-traditional tree: commit 18a08a23da88863435d56a0b14ff72013ef3b003 Author: Olaf Hering Date: Tue Oct 15 11:42:26 2013 +0200 = qemu-traditional: do not strip binaries during make install = It is wrong to strip code during make install, unless explicit requested. Introduce a new variable INSTALL_PROG and use it alo= ng with an optional STRIP_OPT where currently install -s -m 755 is used. This is what upstream qemu offers in version 1.6. = Signed-off-by: Olaf Hering = If you are packaging this as RPM I guess you will also want the accompanying debuginfo RPM installed too, since RPM will have done magic with the unstripped binary. Adding --leak-check=3Dfull and/or --track-origins=3Dyes to the valgrind options might also be helpful. The most plausible candidate for a leak would seem to be "Syscall param munmap(length) contains uninitialised byte(s)", but that might just be down to "Warning: noted but unhandled ioctl 0x84501 with no size/direction hints" on the corresponding mmap call. Hopefully with debugging symbols things will become clearer. Thanks, Ian.