Red Hat Bugzilla – Bug 810613
Memory leak in virInitialize
Last modified: 2013-12-13 07:41:08 EST
Description of problem:
==24471== Memcheck, a memory error detector
==24471== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==24471== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==24471== Command: /home/rjones/d/libguestfs-1.16/df/.libs/lt-virt-df
==24471== Parent PID: 24470
==24471== HEAP SUMMARY:
==24471== in use at exit: 130,697 bytes in 1,295 blocks
==24471== total heap usage: 4,367 allocs, 3,072 frees, 104,142,842 bytes allocated
==24471== 21 bytes in 1 blocks are definitely lost in loss record 70 of 185
==24471== at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==24471== by 0x3B16885B51: strdup (in /usr/lib64/libc-2.15.so)
==24471== by 0x3B28805CBB: p11_kit_registered_module_to_name (in /usr/lib64/libp11-kit.so.0.0.0)
==24471== by 0x3B2A048294: gnutls_pkcs11_init (in /usr/lib64/libgnutls.so.26.22.0)
==24471== by 0x3B2A031CE1: gnutls_global_init (in /usr/lib64/libgnutls.so.26.22.0)
==24471== by 0x3B326CE219: virInitialize (in /usr/lib64/libvirt.so.0.9.10)
==24471== by 0x3B326CEF56: virConnectOpenReadOnly (in /usr/lib64/libvirt.so.0.9.10)
==24471== by 0x4045B6: get_domains_from_libvirt (domains.c:111)
==24471== by 0x40308A: main (main.c:264)
==24471== LEAK SUMMARY:
==24471== definitely lost: 21 bytes in 1 blocks
==24471== indirectly lost: 0 bytes in 0 blocks
==24471== possibly lost: 0 bytes in 0 blocks
==24471== still reachable: 130,327 bytes in 1,276 blocks
==24471== suppressed: 349 bytes in 18 blocks
==24471== Reachable blocks (those to which a pointer was found) are not shown.
==24471== To see them, rerun with: --leak-check=full --show-reachable=yes
==24471== For counts of detected and suppressed errors, rerun with: -v
==24471== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 20 from 20)
Version-Release number of selected component (if applicable):
$ rpm -qf /usr/lib64/libp11-kit.so.0.0.0
$ rpm -qf /usr/lib64/libgnutls.so.26.22.0
$ rpm -qf /usr/lib64/libvirt.so.0.9.10
$ ./run ./fish/guestfish version
(also happens on 1.17.25)
100% on a machine that has 1 libvirt domain
0% on a basically identical machine that has > 1 domains
This is the reproducing command:
./run valgrind --leak-check=full --suppressions=tests/extra/suppressions ./df/virt-df -c qemu:///system
Bug also occurs with
from Fedora updates-testing.
Looks like a bug in libvirt. I raised the issue on libvir-list:
Reassigning to libvirt (note that the real bug is lack
of thread safety in gnutls).
For discussion, see the thread in comment 3.
Well there's nothing we can really do about this in libvirt. My suggestion is to add a wildcard against 'gnutls_global_init' to your valgrind suppressions file.
Should this be moved to gnutls or closed as CANTFIX?