Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 770940 - memory leaks on libvirt_virDomainGetSchedulerParameters
memory leaks on libvirt_virDomainGetSchedulerParameters
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: Alex Jia
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-30 06:44 EST by Alex Jia
Modified: 2012-06-20 02:40 EDT (History)
7 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 02:40:35 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)
vargrind result (24.62 KB, text/plain)
2012-02-17 04:19 EST, zhpeng
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 15:31:38 EDT

  None (edit)
Description Alex Jia 2011-12-30 06:44:24 EST
Description of problem:
Memory leaks on libvirt_virDomainGetSchedulerParameters and libvirt_virDomainGetSchedulerParametersFlags APIs.

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.schedulerParameters()
dom.schedulerParametersFlags(0)

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

==2127== 96 bytes in 3 blocks are definitely lost in loss record 1,437 of 2,083
==2127==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==2127==    by 0x39E1A85EC3: PyObject_Malloc (obmalloc.c:935)
==2127==    by 0x39E1A77831: _PyLong_New (longobject.c:75)
==2127==    by 0x39E1A79EB6: PyLong_FromLongLong (longobject.c:864)
==2127==    by 0xB8FA1D0: libvirt_virDomainGetSchedulerParameters (libvirt-override.c:353)
==2127==    by 0x39E1ADE7F3: PyEval_EvalFrameEx (ceval.c:3794)
==2127==    by 0x39E1ADF99E: PyEval_EvalFrameEx (ceval.c:3880)
==2127==    by 0x39E1AE0466: PyEval_EvalCodeEx (ceval.c:3044)
==2127==    by 0x39E1AE0541: PyEval_EvalCode (ceval.c:545)
==2127==    by 0x39E1AFB88B: run_mod (pythonrun.c:1351)
==2127==    by 0x39E1AFB95F: PyRun_FileExFlags (pythonrun.c:1337)
==2127==    by 0x39E1AFCE4B: PyRun_SimpleFileExFlags (pythonrun.c:941)
==2127==
==2127== 151 bytes in 3 blocks are definitely lost in loss record 1,511 of 2,083
==2127==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==2127==    by 0x39E1A85EC3: PyObject_Malloc (obmalloc.c:935)
==2127==    by 0x39E1A9053C: PyString_FromString (stringobject.c:138)
==2127==    by 0xB8FA1E4: libvirt_virDomainGetSchedulerParameters (libvirt-override.c:370)
==2127==    by 0x39E1ADE7F3: PyEval_EvalFrameEx (ceval.c:3794)
==2127==    by 0x39E1ADF99E: PyEval_EvalFrameEx (ceval.c:3880)
==2127==    by 0x39E1AE0466: PyEval_EvalCodeEx (ceval.c:3044)
==2127==    by 0x39E1AE0541: PyEval_EvalCode (ceval.c:545)
==2127==    by 0x39E1AFB88B: run_mod (pythonrun.c:1351)
==2127==    by 0x39E1AFB95F: PyRun_FileExFlags (pythonrun.c:1337)
==2127==    by 0x39E1AFCE4B: PyRun_SimpleFileExFlags (pythonrun.c:941)
==2127==    by 0x39E1B094CE: Py_Main (main.c:577)

==2127== 96 bytes in 3 blocks are definitely lost in loss record 1,437 of 2,083
==2127==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==2127==    by 0x39E1A85EC3: PyObject_Malloc (obmalloc.c:935)
==2127==    by 0x39E1A77831: _PyLong_New (longobject.c:75)
==2127==    by 0x39E1A79EB6: PyLong_FromLongLong (longobject.c:864)
==2127==    by 0xB8F9BE8: libvirt_virDomainGetSchedulerParametersFlags (libvirt-override.c:435)
==2127==    by 0x39E1ADE7F3: PyEval_EvalFrameEx (ceval.c:3794)
==2127==    by 0x39E1ADF99E: PyEval_EvalFrameEx (ceval.c:3880)
==2127==    by 0x39E1AE0466: PyEval_EvalCodeEx (ceval.c:3044)
==2127==    by 0x39E1AE0541: PyEval_EvalCode (ceval.c:545)
==2127==    by 0x39E1AFB88B: run_mod (pythonrun.c:1351)
==2127==    by 0x39E1AFB95F: PyRun_FileExFlags (pythonrun.c:1337)
==2127==    by 0x39E1AFCE4B: PyRun_SimpleFileExFlags (pythonrun.c:941)
==2127==
==2127== 151 bytes in 3 blocks are definitely lost in loss record 1,511 of 2,083
==2127==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==2127==    by 0x39E1A85EC3: PyObject_Malloc (obmalloc.c:935)
==2127==    by 0x39E1A9053C: PyString_FromString (stringobject.c:138)
==2127==    by 0xB8F9BFC: libvirt_virDomainGetSchedulerParametersFlags (libvirt-override.c:452)
==2127==    by 0x39E1ADE7F3: PyEval_EvalFrameEx (ceval.c:3794)
==2127==    by 0x39E1ADF99E: PyEval_EvalFrameEx (ceval.c:3880)
==2127==    by 0x39E1AE0466: PyEval_EvalCodeEx (ceval.c:3044)
==2127==    by 0x39E1AE0541: PyEval_EvalCode (ceval.c:545)
==2127==    by 0x39E1AFB88B: run_mod (pythonrun.c:1351)
==2127==    by 0x39E1AFB95F: PyRun_FileExFlags (pythonrun.c:1337)
==2127==    by 0x39E1AFCE4B: PyRun_SimpleFileExFlags (pythonrun.c:941)
==2127==    by 0x39E1B094CE: Py_Main (main.c:577)


Expected results:
Fix memory leaks.

Additional info:
Comment 1 Alex Jia 2012-02-14 02:21:17 EST
The memory leaks have been fixed by refactoring python binding codes:

commit 56cec18d761a1f99862c43811de60380c65881e6
Author: Guannan Ren <gren@redhat.com>
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 02:28:34 EST
This also made 0.9.10 so should be fixed in libvirt-0.9.10-1.el6

Daniel
Comment 5 zhpeng 2012-02-17 04:14:38 EST
Tested with:
libvirt-python-0.9.10-1.el6.x86_64

valgrind result is attached.
Test passed.
Comment 6 zhpeng 2012-02-17 04:19:44 EST
Created attachment 563857 [details]
vargrind result
Comment 8 errata-xmlrpc 2012-06-20 02:40:35 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.