[ libvirt-python BUG ?] Memory leak in libvirt_virConnectDomainEventJobCompletedCallback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

It seems that, there is a memory leak bug in libvirt_virConnectDomainEventJobCompletedCallback()
function of libvirt-override.c.

We didn't decrease the reference of 'pyobj_dict' in this function or any other places
while pyt0bj_ret is not zero.

libvirt_virConnectDomainEventJobCompletedCallback()
{
  ... ...

  pyobj_ret = PyObject_CallMethod(pyobj_conn,
                                    (char*)"_dispatchDomainEventJobCompletedCallback",
                                    (char*)"OOO",
                                    pyobj_dom, pyobj_dict, pyobj_cbData);

    Py_DECREF(pyobj_cbData);
    Py_DECREF(pyobj_dom);

 cleanup:
    if (!pyobj_ret) {
        DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
        PyErr_Print();
        Py_XDECREF(pyobj_dict);
    } else {
        Py_DECREF(pyobj_ret);
        ret = 0;
    }

    LIBVIRT_RELEASE_THREAD_STATE;
    return ret;
}

I don't think the reference of pyobj_dict will be stolen by PyObject_CallMethod
when it is passed to the Python function _dispatchDomainEventJobCompletedCallback.

In fact, we have a test which triggered lots of events and found that the memory
of the test process will keep raising slowly and could not be reclaimed
even we called gc.collect() explicitly in our codes.

So, is it a bug ? Any comments ?

Thanks,
hailiang


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux