[libvirt] Memory leak in libvirt / gnutls

Daniel P. Berrange berrange at redhat.com
Tue Apr 10 11:14:13 UTC 2012


On Tue, Apr 10, 2012 at 12:08:14PM +0100, Richard W.M. Jones wrote:
> On Mon, Apr 09, 2012 at 10:19:38AM -0600, Eric Blake wrote:
> > On 04/07/2012 03:33 AM, Richard W.M. Jones wrote:
> > 
> > > However the above commit is later amended by this commit:
> > > 
> > > ----------------------------------------------------------------------
> > >   commit eaddec976ef06457fee4a4ce86b8c7ee906183b7
> > >   Author: Michal Privoznik <mprivozn at redhat.com>
> > >   Date:   Wed Aug 24 16:16:45 2011 +0200
> > > 
> > >     daemon: Move TLS initialization to virInitialize
> > >     
> > >     My previous patch 74c75671331d284e1f777f9692b72e9737520bf0
> > >     introduced a regression by removing TLS initialization from client.
> > > ----------------------------------------------------------------------
> > > 
> > > which removes virNetTLSDeinit.  This appears to be a mistake, or at
> > > least I can't see the logical reason for it, and according to the
> > > gnutls docs, it would introduce a memory leak looking exactly like the
> > > one I am chasing down.
> > 
> > I remember asking at the time, and seem to remember this answer:
> > 
> > gnutls_global_init is not thread-safe, and therefore must not be called
> > in the context of a library that might be in use by a multi-threaded
> > parent application.
> 
> OK, although this function we *do* call :-)
> 
> > Same goes for gnutls_global_deinit.
> 
> There's still a confusing comment in libvirt.  Take a look at the very
> bottom of 'src/rpc/virnettlscontext.c'.

Yep that comment is bogus


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list