[libvirt] [PATCH] cygwin: fix abort of virsh on my system

Daniel Veillard veillard at redhat.com
Fri May 7 08:29:11 UTC 2010


On Thu, May 06, 2010 at 02:55:31PM -0400, Stefan Berger wrote:
> Chris Lalancette <clalance at redhat.com> wrote on 05/06/2010 02:28:18 PM:
> 
> 
> > On 05/06/2010 02:11 PM, Stefan Berger wrote:
> > > This strange patch fixes aborts of virsh on my system. It seems that 
> the
> > > string returned by xmlSaveUri is owned by the xml library??
> > 
> 
> [...]

  it should not, libxml2 will use malloc (assuming xmlMalloc is not
  changed to point to something else).

> > 
> > So something else might be going on.  What version of libxml2
> > are you currently building against?
> 
> Cygwin picks up what I have installed in /cydrive/c/GTK/ and there I have 
> version 2.6.32.
> 
> xmlversion.h:#define LIBXML_DOTTED_VERSION "2.6.32"
> 
> The abort occurs upon the VIR_FREE(name).

  The *big* problem is that if the library was compiled with a
different toolchain, or sometimes even slightly different options
you may end up with the malloc used by libxml2 and initialized by
a reference at comoilation time, to be different and incompatible
with the malloc/free used by libvirt. This blows up very frequently
when people compile with the microsoft tool chain, and less frequently
on cygwin but this can happen.
  As 0.6.2 is rather ancient to say the least, maybe rebuilding
libxml2 with your current cygwin and making sure libvirt uses that one
could fix the problem.

  I would say that 90% of the Windows specific problems reported for
libxml2 are due to incompatibilities between runtime especially at the
memory allocation problem, it's a serious pain !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list