[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Found memory leak in libxenstore



On Mon, Sep 07, 2015 at 11:37:48AM +0100, Wei Liu wrote:
> I only had a brief look at this.
> 
> On Mon, Sep 07, 2015 at 09:52:08AM +0000, Sunguodong wrote:
> > Hi,
> > I found this memory leak on xen-4.5.0:
> > linux-byXjTX:~ # virsh version
> > Compiled against library: libvirt 1.2.17
> > Using library: libvirt 1.2.17
> > Using API: Xen 1.2.17
> > Running hypervisor: Xen 4.5.0
> > 
> > Steps to produce this leak:
> > 
> > 1.       Start a vm, win7_64_2U_vhd, for example.
> > 
> > 2.       Stop libvirtd and start it with valgrind, using the following 
> > command:
> > 
> > valgrind --tool=memcheck --log-file=xs.log --leak-check=full 
> > --show-reachable=yes --track-origins=yes --trace-children=yes --verbose 
> > libvirtd -d -l
> > 
> > 3.       Wait until libvirtd started, then reboot the vm:
> > 
> > virsh reboot win7_64_2U_vhd
> > 
> > 4.       After vm restarted, kill valgind with signal 3:
> > 
> > kill -3 27483 (27483 is the pid of valgrind)
> > 
> > 5.       Open xs.log, search 'definitely', we will always find this leak:
> > 
> > ==28989== 40 bytes in 1 blocks are definitely lost in loss record 327 of 585
> > 
> > ==28989==    at 0x4C27B9B: malloc (vg_replace_malloc.c:263)
> > 
> > ==28989==    by 0x7EBD618: read_message (xs.c:1146)
> > 
> > ==28989==    by 0x7EBE8C6: read_thread (xs.c:1222)
> > 
> > ==28989==    by 0x74F8805: start_thread (in /lib64/libpthread-2.11.3.so)
> > 
> > ==28989==    by 0x77EC66C: clone (in /lib64/libc-2.11.3.so)
> > 
> > When we reboot vm twice, this leak would happen twice either. Could anyone 
> > verify this and fix it?
> 
> Those messages are freed after the connection is closed. Are you sure
> they are still there after you close the connection?
> 

Another theory is that libvirt never closes the connection. I do think
this is a bit undesirable (that, messages are not freed until connection
is closed), but unfortunately I don't have time for this until 4.6 is
out.

Wei.

> Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.