Package: libvirt-bin
Version: 0.8.0-2
Severity: important
Tags: patch

A bug was reported to Ubuntu in which the libvirtd service (provided
by libvirt-bin) would consume resident memory while processing udev
add/change/remove events) without properly releasing it, thus creating
a memory leak that on some affected systems was causing an OOM issue.

The attached patch is what Ubuntu is proposing to fix the issue under
libvirt 0.7.x, the same patch (with modified line numbers) has been
submitted to upstream libvirt development.

This bug is an attempt to ensure that Debian packages benefit from
Ubuntu patches.

Other references:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/571093 - Ubuntu
Bug for this issue
 - Comments 19 & 20 contain my analysis of the cause of the issue.
https://www.redhat.com/archives/libvir-list/2010-May/msg00920.html -
Post on upstream mailing list for this patch.

Cheers,
Index: libvirt-0.7.5/src/node_device/node_device_udev.c
===================================================================
--- libvirt-0.7.5.orig/src/node_device/node_device_udev.c	2010-05-25 02:26:36.000000000 +1200
+++ libvirt-0.7.5/src/node_device/node_device_udev.c	2010-05-25 02:29:35.000000000 +1200
@@ -1247,6 +1247,9 @@
     ret = 0;
 
 out:
+    if (ret != 0) {
+       virNodeDeviceDefFree(def); /* Free assigned memory to prevent leaks */
+    }
     return ret;
 }
 
@@ -1373,6 +1376,7 @@
     }
 
 out:
+    udev_device_unref(device);
     return;
 }
 

Reply via email to