rpm-python memory leaks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
RPM |
New
|
Undecided
|
Unassigned | ||
rpm (CentOS) |
Invalid
|
Undecided
|
Bug Description
(quoted from http://
Various functions in the Python bindings have expressions of the form:
PyObject_
This leaks memory for the case when Py_BuildValue succeeds (it returns
a new reference, which is never freed; PyObject_Call doesn't steal the
reference): the argument tuple and all of its components will not be
freed (until the process exits).
There's also a possible segfault for the case where Py_BuildValue fails:
PyObject_Call will likely segfault with a NULL 2nd argument.
This affects:
python/
python/
python/
python/
It's better to use PyObject_
http://
which can construct the argument tuple in a similar fashion to Py_BuildValue,
but handles cleanup and failures for you.
Also, if all arguments are already PyObject*, PyObject_
is faster:
http://
tags: | added: python |
tags: | added: memleak |
Changed in rpm (CentOS): | |
importance: | Unknown → Undecided |
status: | Unknown → Invalid |
+++ This bug was initially created as a clone of Bug #782147 +++
setroubleshoot uses the rpm python bindings and is a long running service, Each time an AVC arrives it checks on the version of selinux policy, the kernel, and potentially the version of the source program and the target program to identify which version of the package was being used. If we are hit with a storm of AVC's we are seeing the memory skyrocket. We diagnosed the problem to rpm python bindings leaking. For now we are removing the bindings and going to executing rpm -qf PATH. Not an ideal solution, but we need this fix in RHEL5 and RHEL6. As well as Fedora.
--- Additional comment from <email address hidden> on 2012-01-16 11:32:37 EST ---
Dave Malcolm, believes he has a fix for this problem.
http:// lists.rpm. org/pipermail/ rpm-maint/ 2011-December/ 003138. html