[libvirt] Memory leak in virInitialize -> vboxRegister -> VBoxCGlueInit

Eric Blake eblake at redhat.com
Mon Aug 13 15:53:22 UTC 2012


On 08/13/2012 01:57 AM, Daniel P. Berrange wrote:
> On Sat, Aug 11, 2012 at 07:45:19AM +0100, Richard W.M. Jones wrote:
>> https://bugzilla.redhat.com/show_bug.cgi?id=847429
>>
>> Spotted by valgrind:
>>
>> ==2390== 45 bytes in 1 blocks are definitely lost in loss record 68 of 123

>> ==2390==    by 0x5817568: virInitialize (libvirt.c:450)
>> ==2390==    by 0x5492C02: init_libguestfs (guestfs.c:108)
>>
>> libvirt-0.10.0-0rc0.fc18.x86_64
>>
>> libguestfs calls virInitialize, but (since there is no cleanup
>> function) doesn't do any corresponding cleanup.  Is that correct?
> 
> Yep, virInitialize does global one-time initialization and we don't
> provide any de-initialization function, so any memory allocations
> should be considered global state. You'll want to provide a valgrind
> suppressions file which whitelists any stack trace below the
> virInitialize function.

Should libvirt be providing a suppression file as part of the
installation to make it easier for others to ignore known one-shot
initializations?

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120813/489556f3/attachment-0001.sig>


More information about the libvir-list mailing list