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 1140998 - Memory leak in python binding of XMLDesc
Summary: Memory leak in python binding of XMLDesc
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt-python
Version: 7.1
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-12 08:07 UTC by Alex Jia
Modified: 2015-03-05 07:56 UTC (History)
0 users

Fixed In Version: libvirt-python-1.2.8-3.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:56:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0334 0 normal SHIPPED_LIVE new packages: libvirt-python 2015-03-05 12:23:16 UTC

Description Alex Jia 2014-09-12 08:07:49 UTC
Description of problem:
The premier memory leak is reported by Jun'ichi Nomura from NEC Corporation, I can also reproduce the bug on libvirt-python-1.2.8-2.el7.x86_64 via valgrind.

Version-Release number of selected component (if applicable):
libvirt-python-1.2.8-2.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. # cat demo.py 
#!/usr/bin/env python

import sys
import libvirt

if __name__ == "__main__":
    vm_name = sys.argv[1]
    con = libvirt.open(None)
    dom = con.lookupByName(vm_name)
    dom.XMLDesc()

2. # valgrind -v --leak-check=full --log-file=/tmp/leak /usr/bin/python demo.py <vm_name>

3. # grep 'definitely' /tmp/leak

Actual results:

==14809== 2,407 bytes in 1 blocks are definitely lost in loss record 1,457 of 1,550
==14809==    at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==14809==    by 0x5C46624: xdr_string (in /usr/lib64/libc-2.17.so)
==14809==    by 0xCFDE5FD: xdr_remote_nonnull_string (remote_protocol.c:31)
==14809==    by 0xCFE0948: xdr_remote_domain_get_xml_desc_ret (remote_protocol.c:1617)
==14809==    by 0xCFF4FF1: virNetMessageDecodePayload (virnetmessage.c:407)
==14809==    by 0xCFEB06B: virNetClientProgramCall (virnetclientprogram.c:379)
==14809==    by 0xCFC28B1: callFull.isra.2 (remote_driver.c:6625)
==14809==    by 0xCFCC0F4: remoteDomainGetXMLDesc (remote_driver.c:6647)
==14809==    by 0xCF8488C: virDomainGetXMLDesc (libvirt.c:4380)
==14809==    by 0xCC2CE0F: libvirt_virDomainGetXMLDesc (libvirt.c:1141)
==14809==    by 0x4F12B93: PyEval_EvalFrameEx (in /usr/lib64/libpython2.7.so.1.0)
==14809==    by 0x4F141AC: PyEval_EvalCodeEx (in /usr/lib64/libpython2.7.so.1.0)


Expected results:
Fix this.

Additional info:

Comment 1 Michal Privoznik 2014-09-12 09:01:46 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2014-September/msg00749.html

Comment 4 Alex Jia 2014-09-22 02:29:41 UTC
The memory leak has been fixed on libvirt-python-1.2.8-3.el7.x86_64, so move the bug to VERIFIED status.

# valgrind -v --leak-check=full --log-file=/tmp/leak /usr/bin/python demo.py <vm_name>

# grep 'definitely' /tmp/leak
==32588==    definitely lost: 0 bytes in 0 blocks

Comment 6 errata-xmlrpc 2015-03-05 07:56:53 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.

https://rhn.redhat.com/errata/RHBA-2015-0334.html


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