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 770941 - memory leaks on libvirt_virDomainGetMemoryParameters
Summary: memory leaks on libvirt_virDomainGetMemoryParameters
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: Alex Jia
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-30 11:44 UTC by Alex Jia
Modified: 2012-06-20 06:40 UTC (History)
7 users (show)

Fixed In Version: libvirt-0.9.10-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 06:40:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
vargrind result (24.62 KB, text/plain)
2012-02-17 07:46 UTC, zhpeng
no flags Details


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 2011-12-30 11:44:49 UTC
Description of problem:
Memory leak on libvirt_virDomainGetMemoryParameters API.

Version-Release number of selected component (if applicable):
libvirt-python-0.9.9-0rc1.el6.x86_64.rpm

How reproducible:
always

Steps to Reproduce:
1. Paste the following codes into test.py:

import libvirt
con = libvirt.open(None)
dom = con.lookupByName('foo')
dom.memoryParameters(0)

2. valgrind -v --leak-check=full python test.py
  
Actual results:

==2767== 120 bytes in 3 blocks are definitely lost in loss record 1,467 of 2,085
==2767==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==2767==    by 0x39E1A85EC3: PyObject_Malloc (obmalloc.c:935)
==2767==    by 0x39E1A77831: _PyLong_New (longobject.c:75)
==2767==    by 0x39E1A79EB6: PyLong_FromLongLong (longobject.c:864)
==2767==    by 0xB8F8D98: libvirt_virDomainGetMemoryParameters (libvirt-override.c:998)
==2767==    by 0x39E1ADE7F3: PyEval_EvalFrameEx (ceval.c:3794)
==2767==    by 0x39E1ADF99E: PyEval_EvalFrameEx (ceval.c:3880)
==2767==    by 0x39E1AE0466: PyEval_EvalCodeEx (ceval.c:3044)
==2767==    by 0x39E1AE0541: PyEval_EvalCode (ceval.c:545)
==2767==    by 0x39E1AFB88B: run_mod (pythonrun.c:1351)
==2767==    by 0x39E1AFB95F: PyRun_FileExFlags (pythonrun.c:1337)
==2767==    by 0x39E1AFCE4B: PyRun_SimpleFileExFlags (pythonrun.c:941)
==2767==
==2767== 155 bytes in 3 blocks are definitely lost in loss record 1,515 of 2,085
==2767==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==2767==    by 0x39E1A85EC3: PyObject_Malloc (obmalloc.c:935)
==2767==    by 0x39E1A9053C: PyString_FromString (stringobject.c:138)
==2767==    by 0xB8F8DAC: libvirt_virDomainGetMemoryParameters (libvirt-override.c:1015)
==2767==    by 0x39E1ADE7F3: PyEval_EvalFrameEx (ceval.c:3794)
==2767==    by 0x39E1ADF99E: PyEval_EvalFrameEx (ceval.c:3880)
==2767==    by 0x39E1AE0466: PyEval_EvalCodeEx (ceval.c:3044)
==2767==    by 0x39E1AE0541: PyEval_EvalCode (ceval.c:545)
==2767==    by 0x39E1AFB88B: run_mod (pythonrun.c:1351)
==2767==    by 0x39E1AFB95F: PyRun_FileExFlags (pythonrun.c:1337)
==2767==    by 0x39E1AFCE4B: PyRun_SimpleFileExFlags (pythonrun.c:941)
==2767==    by 0x39E1B094CE: Py_Main (main.c:577)

Expected results:


Additional info:

Comment 1 Alex Jia 2012-02-14 07:19:56 UTC
The memory leaks have been fixed by refactoring python binding codes:

commit 56cec18d761a1f99862c43811de60380c65881e6
Author: Guannan Ren <gren>
Date:   Fri Feb 10 18:17:26 2012 +0800

    python: make other APIs share common {get, set}PyVirTypedParameter
    
            *libvirt_virDomainBlockStatsFlags
            *libvirt_virDomainGetSchedulerParameters
            *libvirt_virDomainGetSchedulerParametersFlags
            *libvirt_virDomainSetSchedulerParameters
            *libvirt_virDomainSetSchedulerParametersFlags
            *libvirt_virDomainSetBlkioParameters
            *libvirt_virDomainGetBlkioParameters
            *libvirt_virDomainSetMemoryParameters
            *libvirt_virDomainGetMemoryParameters
            *libvirt_virDomainSetBlockIoTune
            *libvirt_virDomainGetBlockIoTune

So move it to POST status.

Comment 2 Daniel Veillard 2012-02-17 07:25:14 UTC
That actually made 0.9.10 release so should be fixed in libvirt-0.9.10-1.el6

Daniel

Comment 4 zhpeng 2012-02-17 07:45:17 UTC
Tested with:
libvirt-python-0.9.10-1.el6.x86_64

valgrind result is attached.
Test passed.

Comment 5 zhpeng 2012-02-17 07:46:08 UTC
Created attachment 563848 [details]
vargrind result

Comment 9 errata-xmlrpc 2012-06-20 06:40:38 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.