RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 798497 - Plug memory leak on migration
Summary: Plug memory leak on migration
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-29 03:37 UTC by Alex Jia
Modified: 2012-06-20 06:49 UTC (History)
6 users (show)

Fixed In Version: libvirt-0.9.10-6.el6
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Clone Of:
Environment:
Last Closed: 2012-06-20 06:49:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Description Alex Jia 2012-02-29 03:37:52 UTC
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 22:13:54 UTC
Alex, do you have a patch for this one?

Comment 2 Alex Jia 2012-03-01 02:23:06 UTC
(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 11:07:32 UTC
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 13:27:54 UTC
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 13:34:42 UTC
(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 13:44:49 UTC
Ok, given that, we need to fix this in 6.3.

Comment 9 Osier Yang 2012-03-16 13:56:26 UTC
(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 10:38:48 UTC
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 07:10:29 UTC
    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 06:49:18 UTC
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.