Bug 798497 - Plug memory leak on migration
Plug memory leak on migration
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
x86_64 Linux
high Severity high
: rc
: ---
Assigned To: Osier Yang
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-28 22:37 EST by Alex Jia
Modified: 2012-06-20 02:49 EDT (History)
6 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-6.el6
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 02:49:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alex Jia 2012-02-28 22:37:52 EST
Description of problem:
Plug memory leak on migration.

Version-Release number of selected component (if applicable):
# rpm -q libvirt
libvirt-0.9.10-3.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. configure migration environment
2. virsh start <domain>
3. valgrind -v --leak-check=full virsh migrate <domain> qemu+ssh://<target ip>/system --unsafe
  
Actual results:

==30879== 8 bytes in 1 blocks are definitely lost in loss record 1 of 30
==30879==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==30879==    by 0x39CF115FB8: xdr_reference (in /lib64/libc-2.12.so)
==30879==    by 0x39CF115F10: xdr_pointer (in /lib64/libc-2.12.so)
==30879==    by 0x4D52614: xdr_remote_string (remote_protocol.c:40)
==30879==    by 0x4D52680: xdr_remote_domain_migrate_prepare3_ret (remote_protocol.c:4772)
==30879==    by 0x4D6F742: virNetMessageDecodePayload (virnetmessage.c:382)
==30879==    by 0x4D5BCDF: virNetClientProgramCall (virnetclientprogram.c:382)
==30879==    by 0x4D384EB: callWithFD (remote_driver.c:4547)
==30879==    by 0x4D3858B: call (remote_driver.c:4568)
==30879==    by 0x4D44F34: remoteDomainMigratePrepare3 (remote_driver.c:4136)
==30879==    by 0x4D27240: virDomainMigrateVersion3 (libvirt.c:4809)
==30879==    by 0x4D28A6C: virDomainMigrate2 (libvirt.c:5448)
==30879==
==30879== LEAK SUMMARY:
==30879==    definitely lost: 8 bytes in 1 blocks

Expected results:
avoid memory leak.

Additional info:
Comment 1 Dave Allan 2012-02-29 17:13:54 EST
Alex, do you have a patch for this one?
Comment 2 Alex Jia 2012-02-29 21:23:06 EST
(In reply to comment #1)
> Alex, do you have a patch for this one?

Hello Dave,
I'm trying to find a right place to fix the leak firstly.

Regards,
Alex
Comment 5 Osier Yang 2012-03-16 07:07:32 EDT
patch posted internally, move to POST.

http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-March/msg01476.html
Comment 6 Dave Allan 2012-03-16 09:27:54 EDT
Osier, can you describe the leak?  Is the leak in virsh or the daemon or both, and what action by the user causes the leak to occur?  Is it an error path or a normal use case?
Comment 7 Osier Yang 2012-03-16 09:34:42 EDT
(In reply to comment #6)
> Osier, can you describe the leak?  Is the leak in virsh or the daemon or both,
> and what action by the user causes the leak to occur?  Is it an error path or a
> normal use case?

It's leak in remote driver, so each libvirt client will leak, no leak in daemon.

It's not a error path, just a normal use case will cause that.
Comment 8 Dave Allan 2012-03-16 09:44:49 EDT
Ok, given that, we need to fix this in 6.3.
Comment 9 Osier Yang 2012-03-16 09:56:26 EDT
(In reply to comment #8)
> Ok, given that, we need to fix this in 6.3.

Yes, it's leak after every migration operation.
Comment 12 weizhang 2012-03-19 06:38:48 EDT
Verify pass on
libvirt-0.9.10-6.el6.x86_64
qemu-kvm-0.12.1.2-2.246.el6.x86_64
kernel-2.6.32-250.el6.x86_64

Start a guest without cache=none for its disk
No memory leak after migration with --unsafe
==17411== LEAK SUMMARY:
==17411==    definitely lost: 0 bytes in 0 blocks
Comment 13 Osier Yang 2012-05-04 03:10:29 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No documentation needed.
Comment 15 errata-xmlrpc 2012-06-20 02:49:18 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0748.html

Note You need to log in before you can comment on or make changes to this bug.