[libvirt] Confusing valgrind error in virDomainLookupByUUIDString or virReportErrorHelper

Richard W.M. Jones rjones at redhat.com
Mon Jun 27 16:32:07 UTC 2011


libvirt-0.9.2-2.fc16.x86_64

Here's the error from valgrind:

==24953== Conditional jump or move depends on uninitialised value(s)
==24953==    at 0x3DF68844BB: __GI___strcasecmp_l (strcmp.S:243)
==24953==    by 0x3DF68221E1: __gconv_open (gconv_open.c:70)
==24953==    by 0x3DF682F3E9: _nl_find_msg (dcigettext.c:974)
==24953==    by 0x3DF682FB84: __dcigettext (dcigettext.c:640)
==24953==    by 0x36BBE5A063: virReportErrorHelper (virterror.c:1215)
==24953==    by 0x36BBEA3804: virDomainLookupByUUIDString (libvirt.c:2005)
==24953==    by 0x4C9174C: guestfs__add_domain (virt.c:122)
==24953==    by 0x4C4862B: guestfs_add_domain_argv (actions.c:2951)
==24953==    by 0x42635A: add_libvirt_drives (virt.c:54)
==24953==    by 0x4260D8: add_drives (options.c:69)
==24953==    by 0x40B1F6: main (fish.c:422)

It appears to originate from this code:

  src/libvirt.c:virDomainLookupByUUIDString:

         if (virUUIDParse(uuidstr, uuid) < 0) {
2005 **      virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
             goto error;
         }

The macro at line 2005 expands to:

    virReportErrorHelper(VIR_FROM_NONE, VIR_ERR_INVALID_ARG, __FILE__, \
                         __FUNCTION__, __LINE__, __FUNCTION__);

Apparently __FUNCTION__ is deprecated[1].

When virReportErrorHelper is called, the problem appears to be at this
line (virterror.c:1215):

    virerr = virErrorMsg(errcode, (errorMessage[0] ? errorMessage : NULL));

Here, errcode == VIR_ERR_INVALID_ARG and errorMessage is presumably
the function name.

That's as far as I've got for today.  Just letting people know ...

Rich.

[1] http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org




More information about the libvir-list mailing list