[libvirt] Segfault problem with nwfilter-define in Libvirt

Hello, At first a big thanks to Laine, who kindly tried to help me ! My problem is the following : I use a linux from scratch distro ( home made) pure X86_64 glibc 2.10.1 gcc 4.4.1 uname -a SMP Sat Aug 4 20:07:49 CEST 2012 x86_64 x86_64 x86_64 GNU/Linux Each time I use nwfilter-define, libvirtd crash with a segfault. I tried nearly all version from 0.9.8 to 0.9.13 and even 0.10 with the same problem Here is a sample of newfilter.xml : <filter name='nova-base'> <filterref filter='no-ip-spoofing'/> </filter> and here the bt unde gdb with v0.9.13 #0 __pthread_mutex_lock (mutex=0x0) at pthread_mutex_lock.c:50 #1 0x00007ffff77ba07e in virNWFilterCallbackDriversLock () at conf/nwfilter_conf.c:2846 #2 0x00007fffe8ed9d24 in nwfilterDefine (conn=0x67d8e0, xml=0x67e000 "<filter name='nova-base'>\n\t<filterref filter='no-ip-spoofing'/>\n</filter>\n\n") at nwfilter/nwfilter_driver.c:348 #3 0x00007ffff77eb753 in virNWFilterDefineXML (conn=0x67d8e0, xmlDesc=0x67e000 "<filter name='nova-base'>\n\t<filterref filter='no-ip-spoofing'/>\n</filter>\n\n") at libvirt.c:15925 #4 0x000000000041969c in remoteDispatchNWFilterDefineXML (ret=<optimized out>, args=<optimized out>, rerr=<optimized out>, msg=<optimized out>, client=<optimized out>, server=<optimized out>) at remote_dispatch.h:10442 #5 remoteDispatchNWFilterDefineXMLHelper (server=<optimized out>, client=0x67d210, msg=<optimized out>, rerr=0x7fffec57cf60, args=0x67dea0, ret=0x67ba20) at remote_dispatch.h:10422 #6 0x00007ffff784d48d in virNetServerProgramDispatchCall (msg=<optimized out>, client=<optimized out>, server=<optimized out>, prog=<optimized out>) at rpc/virnetserverprogram.c:416 #7 virNetServerProgramDispatch (prog=0x675090, server=0x670370, client=0x67d210, msg=0x67e3d0) at rpc/virnetserverprogram.c:289 #8 0x00007ffff784a0d1 in virNetServerHandleJob (jobOpaque=<optimized out>, opaque=0x670370) at rpc/virnetserver.c:161 #9 0x00007ffff776d282 in virThreadPoolWorker (opaque=<optimized out>) at util/threadpool.c:143 #10 0x00007ffff776c926 in virThreadHelper (data=<optimized out>) at util/threads-pthread.c:161 #11 0x00007ffff457257a in start_thread (arg=<optimized out>) at pthread_create.c:297 #12 0x00007ffff3edd14d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 Thank for help JC

Hi JC, I haven't met this issue with libvirt-0.10.0-0rc0.el6.x86_64 on RHEL6.2, and can successfully define a network filter from an XML file: # virsh nwfilter-define newfilter.xml Network filter nova-base defined from newfilter.xml # virsh nwfilter-dumpxml nova-base <filter name='nova-base' chain='root'> <uuid>6e1fee50-9962-d7c7-d7b6-3f6a436da141</uuid> <filterref filter='no-ip-spoofing'/> </filter> -- Regards, Alex ----- Original Message ----- From: "[Vo2Labs] Jean-Charles Passard" <jcharles@vo2labs.org> To: libvir-list@redhat.com Sent: Thursday, August 9, 2012 12:40:56 AM Subject: [libvirt] Segfault problem with nwfilter-define in Libvirt Hello, At first a big thanks to Laine, who kindly tried to help me ! My problem is the following : I use a linux from scratch distro ( home made) pure X86_64 glibc 2.10.1 gcc 4.4.1 uname -a SMP Sat Aug 4 20:07:49 CEST 2012 x86_64 x86_64 x86_64 GNU/Linux Each time I use nwfilter-define, libvirtd crash with a segfault. I tried nearly all version from 0.9.8 to 0.9.13 and even 0.10 with the same problem Here is a sample of newfilter.xml : <filter name='nova-base'> <filterref filter='no-ip-spoofing'/> </filter> and here the bt unde gdb with v0.9.13 #0 __pthread_mutex_lock (mutex=0x0) at pthread_mutex_lock.c:50 #1 0x00007ffff77ba07e in virNWFilterCallbackDriversLock () at conf/nwfilter_conf.c:2846 #2 0x00007fffe8ed9d24 in nwfilterDefine (conn=0x67d8e0, xml=0x67e000 "<filter name='nova-base'>\n\t<filterref filter='no-ip-spoofing'/>\n</filter>\n\n") at nwfilter/nwfilter_driver.c:348 #3 0x00007ffff77eb753 in virNWFilterDefineXML (conn=0x67d8e0, xmlDesc=0x67e000 "<filter name='nova-base'>\n\t<filterref filter='no-ip-spoofing'/>\n</filter>\n\n") at libvirt.c:15925 #4 0x000000000041969c in remoteDispatchNWFilterDefineXML (ret=<optimized out>, args=<optimized out>, rerr=<optimized out>, msg=<optimized out>, client=<optimized out>, server=<optimized out>) at remote_dispatch.h:10442 #5 remoteDispatchNWFilterDefineXMLHelper (server=<optimized out>, client=0x67d210, msg=<optimized out>, rerr=0x7fffec57cf60, args=0x67dea0, ret=0x67ba20) at remote_dispatch.h:10422 #6 0x00007ffff784d48d in virNetServerProgramDispatchCall (msg=<optimized out>, client=<optimized out>, server=<optimized out>, prog=<optimized out>) at rpc/virnetserverprogram.c:416 #7 virNetServerProgramDispatch (prog=0x675090, server=0x670370, client=0x67d210, msg=0x67e3d0) at rpc/virnetserverprogram.c:289 #8 0x00007ffff784a0d1 in virNetServerHandleJob (jobOpaque=<optimized out>, opaque=0x670370) at rpc/virnetserver.c:161 #9 0x00007ffff776d282 in virThreadPoolWorker (opaque=<optimized out>) at util/threadpool.c:143 #10 0x00007ffff776c926 in virThreadHelper (data=<optimized out>) at util/threads-pthread.c:161 #11 0x00007ffff457257a in start_thread (arg=<optimized out>) at pthread_create.c:297 #12 0x00007ffff3edd14d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 Thank for help JC -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 08/08/2012 12:40 PM, [Vo2Labs] Jean-Charles Passard wrote:
Hello,
At first a big thanks to Laine, who kindly tried to help me !
My problem is the following :
I use a linux from scratch distro ( home made) pure X86_64 glibc 2.10.1 gcc 4.4.1 uname -a SMP Sat Aug 4 20:07:49 CEST 2012 x86_64 x86_64 x86_64 GNU/Linux
Each time I use nwfilter-define, libvirtd crash with a segfault. I tried nearly all version from 0.9.8 to 0.9.13 and even 0.10 with the same problem Here is a sample of newfilter.xml :
<filter name='nova-base'> <filterref filter='no-ip-spoofing'/> </filter>
and here the bt unde gdb with v0.9.13
#0 __pthread_mutex_lock (mutex=0x0) at pthread_mutex_lock.c:50 #1 0x00007ffff77ba07e in virNWFilterCallbackDriversLock () at conf/nwfilter_conf.c:2846
I'm just doing a test build of a patch to fix this, and I'll send it as a reply to this message when I'm done. (It contains a full explanation of the cause of the crash). Thanks for the complete bug report Jean Charles! This was fun to debug :-)

The meat of this patch is just moving the calls to virNWFilterRegisterCallbackDriver from each hypervisor's "register" function into its "initialize" function. The rest is just code movement to allow that, and a new virNWFilterUnRegisterCallbackDriver function to undo what the register function does. The long explanation: There is an array in nwfilter called callbackDrvArray that has pointers to a table of functions for each hypervisor driver that are called by nwfilter. One of those function pointers is to a function that will lock the hypervisor driver. Entries are added to the table by calling each driver's "register" function, which happens quite early in libvirtd's startup. Sometime later, each driver's "initialize" function is called. This function allocates a driver object and stores a pointer to it in a static variable that was previously initialized to NULL. (and here's the important part...) If the "initialize" function fails, the driver object is freed, and that pointer set back to NULL (but the entry in nwfilter's callbackDrvArray is still there). When the "lock the driver" function mentioned above is called, it assumes that the driver was successfully loaded, so it blindly tries to call virMutexLock on "driver->lock". BUT, if the initialize never happened, or if it failed, "driver" is NULL. And it just happens that "lock" is always the first field in driver so it is also NULL. Boom. To fix this, the call to virNWFilterRegisterCallbackDriver for each driver shouldn't be called until the end of its (*already guaranteed successful*) "initialize" function, not during its "register" function (which is currently the case). This implies that there should also be a virNWFilterUnregisterCallbackDriver() function that is called in a driver's "shutdown" function (although in practice, that function is currently never called). --- src/conf/nwfilter_conf.c | 18 +++++++++++++++ src/conf/nwfilter_conf.h | 3 ++- src/libvirt_private.syms | 1 + src/lxc/lxc_driver.c | 60 +++++++++++++++++++++++++----------------------- src/qemu/qemu_driver.c | 60 +++++++++++++++++++++++++----------------------- src/uml/uml_driver.c | 59 ++++++++++++++++++++++++----------------------- 6 files changed, 113 insertions(+), 88 deletions(-) diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index 665ea0c..4fbbc78 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c @@ -2829,6 +2829,24 @@ virNWFilterRegisterCallbackDriver(virNWFilterCallbackDriverPtr cbd) } void +virNWFilterUnRegisterCallbackDriver(virNWFilterCallbackDriverPtr cbd) +{ + int i = 0; + + while (i < nCallbackDriver && callbackDrvArray[i] != cbd) + i++; + + if (i < nCallbackDriver) { + while (i < nCallbackDriver - 1) { + callbackDrvArray[i] = callbackDrvArray[i+1]; + i++; + } + callbackDrvArray[i] = 0; + nCallbackDriver--; + } +} + +void virNWFilterCallbackDriversLock(void) { int i; diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h index 8b05d04..4b58581 100644 --- a/src/conf/nwfilter_conf.h +++ b/src/conf/nwfilter_conf.h @@ -2,7 +2,7 @@ * nwfilter_conf.h: network filter XML processing * (derived from storage_conf.h) * - * Copyright (C) 2006-2010 Red Hat, Inc. + * Copyright (C) 2006-2010, 2012 Red Hat, Inc. * Copyright (C) 2006-2008 Daniel P. Berrange * * Copyright (C) 2010 IBM Corporation @@ -748,6 +748,7 @@ struct _virNWFilterCallbackDriver { }; void virNWFilterRegisterCallbackDriver(virNWFilterCallbackDriverPtr); +void virNWFilterUnRegisterCallbackDriver(virNWFilterCallbackDriverPtr); void virNWFilterCallbackDriversLock(void); void virNWFilterCallbackDriversUnlock(void); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 79b4a18..c023dbf 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -880,6 +880,7 @@ virNWFilterRuleActionTypeToString; virNWFilterRuleDirectionTypeToString; virNWFilterRuleProtocolTypeToString; virNWFilterTestUnassignDef; +virNWFilterUnRegisterCallbackDriver; virNWFilterUnlockFilterUpdates; diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index d118dd2..b7b119c 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -74,6 +74,35 @@ static int lxcStartup(int privileged); static int lxcShutdown(void); virLXCDriverPtr lxc_driver = NULL; +/* callbacks for nwfilter */ +static int +lxcVMFilterRebuild(virConnectPtr conn ATTRIBUTE_UNUSED, + virHashIterator iter, void *data) +{ + virHashForEach(lxc_driver->domains.objs, iter, data); + + return 0; +} + +static void +lxcVMDriverLock(void) +{ + lxcDriverLock(lxc_driver); +} + +static void +lxcVMDriverUnlock(void) +{ + lxcDriverUnlock(lxc_driver); +} + +static virNWFilterCallbackDriver lxcCallbackDriver = { + .name = "LXC", + .vmFilterRebuild = lxcVMFilterRebuild, + .vmDriverLock = lxcVMDriverLock, + .vmDriverUnlock = lxcVMDriverUnlock, +}; + /* Functions */ static virDrvOpenStatus lxcOpen(virConnectPtr conn, @@ -1465,6 +1494,7 @@ static int lxcStartup(int privileged) virLXCProcessAutostartAll(lxc_driver); + virNWFilterRegisterCallbackDriver(&lxcCallbackDriver); return 0; cleanup: @@ -1516,6 +1546,7 @@ static int lxcShutdown(void) return -1; lxcDriverLock(lxc_driver); + virNWFilterUnRegisterCallbackDriver(&lxcCallbackDriver); virDomainObjListDeinit(&lxc_driver->domains); virDomainEventStateFree(lxc_driver->domainEventState); @@ -2654,34 +2685,6 @@ lxcListAllDomains(virConnectPtr conn, return ret; } -static int -lxcVMFilterRebuild(virConnectPtr conn ATTRIBUTE_UNUSED, - virHashIterator iter, void *data) -{ - virHashForEach(lxc_driver->domains.objs, iter, data); - - return 0; -} - -static void -lxcVMDriverLock(void) -{ - lxcDriverLock(lxc_driver); -} - -static void -lxcVMDriverUnlock(void) -{ - lxcDriverUnlock(lxc_driver); -} - -static virNWFilterCallbackDriver lxcCallbackDriver = { - .name = "LXC", - .vmFilterRebuild = lxcVMFilterRebuild, - .vmDriverLock = lxcVMDriverLock, - .vmDriverUnlock = lxcVMDriverUnlock, -}; - /* Function Tables */ static virDriver lxcDriver = { .no = VIR_DRV_LXC, @@ -2761,6 +2764,5 @@ int lxcRegister(void) { virRegisterDriver(&lxcDriver); virRegisterStateDriver(&lxcStateDriver); - virNWFilterRegisterCallbackDriver(&lxcCallbackDriver); return 0; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index dee1268..9bf89bb 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -148,6 +148,35 @@ static void qemuDomainManagedSaveLoad(void *payload, struct qemud_driver *qemu_driver = NULL; +static void +qemuVMDriverLock(void) { + qemuDriverLock(qemu_driver); +}; + + +static void +qemuVMDriverUnlock(void) { + qemuDriverUnlock(qemu_driver); +}; + + +static int +qemuVMFilterRebuild(virConnectPtr conn ATTRIBUTE_UNUSED, + virHashIterator iter, void *data) +{ + virHashForEach(qemu_driver->domains.objs, iter, data); + + return 0; +} + +static virNWFilterCallbackDriver qemuCallbackDriver = { + .name = QEMU_DRIVER_NAME, + .vmFilterRebuild = qemuVMFilterRebuild, + .vmDriverLock = qemuVMDriverLock, + .vmDriverUnlock = qemuVMDriverUnlock, +}; + + struct qemuAutostartData { struct qemud_driver *driver; virConnectPtr conn; @@ -754,6 +783,7 @@ qemudStartup(int privileged) { if (conn) virConnectClose(conn); + virNWFilterRegisterCallbackDriver(&qemuCallbackDriver); return 0; out_of_memory: @@ -843,6 +873,7 @@ qemudShutdown(void) { return -1; qemuDriverLock(qemu_driver); + virNWFilterUnRegisterCallbackDriver(&qemuCallbackDriver); pciDeviceListFree(qemu_driver->activePciHostdevs); pciDeviceListFree(qemu_driver->inactivePciHostdevs); usbDeviceListFree(qemu_driver->activeUsbHostdevs); @@ -13380,37 +13411,8 @@ static virStateDriver qemuStateDriver = { .active = qemudActive, }; -static void -qemuVMDriverLock(void) { - qemuDriverLock(qemu_driver); -}; - - -static void -qemuVMDriverUnlock(void) { - qemuDriverUnlock(qemu_driver); -}; - - -static int -qemuVMFilterRebuild(virConnectPtr conn ATTRIBUTE_UNUSED, - virHashIterator iter, void *data) -{ - virHashForEach(qemu_driver->domains.objs, iter, data); - - return 0; -} - -static virNWFilterCallbackDriver qemuCallbackDriver = { - .name = QEMU_DRIVER_NAME, - .vmFilterRebuild = qemuVMFilterRebuild, - .vmDriverLock = qemuVMDriverLock, - .vmDriverUnlock = qemuVMDriverUnlock, -}; - int qemuRegister(void) { virRegisterDriver(&qemuDriver); virRegisterStateDriver(&qemuStateDriver); - virNWFilterRegisterCallbackDriver(&qemuCallbackDriver); return 0; } diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index a4a9258..91698e1 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -146,6 +146,34 @@ static int umlMonitorCommand(const struct uml_driver *driver, static struct uml_driver *uml_driver = NULL; +static int +umlVMFilterRebuild(virConnectPtr conn ATTRIBUTE_UNUSED, + virHashIterator iter, void *data) +{ + virHashForEach(uml_driver->domains.objs, iter, data); + + return 0; +} + +static void +umlVMDriverLock(void) +{ + umlDriverLock(uml_driver); +} + +static void +umlVMDriverUnlock(void) +{ + umlDriverUnlock(uml_driver); +} + +static virNWFilterCallbackDriver umlCallbackDriver = { + .name = "UML", + .vmFilterRebuild = umlVMFilterRebuild, + .vmDriverLock = umlVMDriverLock, + .vmDriverUnlock = umlVMDriverUnlock, +}; + struct umlAutostartData { struct uml_driver *driver; virConnectPtr conn; @@ -505,6 +533,7 @@ umlStartup(int privileged) VIR_FREE(userdir); + virNWFilterRegisterCallbackDriver(¨CallbackDriver); return 0; out_of_memory: @@ -603,6 +632,7 @@ umlShutdown(void) { return -1; umlDriverLock(uml_driver); + virNWFilterRegisterCallbackDriver(¨CallbackDriver); if (uml_driver->inotifyWatch != -1) virEventRemoveHandle(uml_driver->inotifyWatch); VIR_FORCE_CLOSE(uml_driver->inotifyFD); @@ -2596,15 +2626,6 @@ static virDriver umlDriver = { .nodeSuspendForDuration = nodeSuspendForDuration, /* 0.9.8 */ }; -static int -umlVMFilterRebuild(virConnectPtr conn ATTRIBUTE_UNUSED, - virHashIterator iter, void *data) -{ - virHashForEach(uml_driver->domains.objs, iter, data); - - return 0; -} - static virStateDriver umlStateDriver = { .name = "UML", .initialize = umlStartup, @@ -2613,28 +2634,8 @@ static virStateDriver umlStateDriver = { .active = umlActive, }; -static void -umlVMDriverLock(void) -{ - umlDriverLock(uml_driver); -} - -static void -umlVMDriverUnlock(void) -{ - umlDriverUnlock(uml_driver); -} - -static virNWFilterCallbackDriver umlCallbackDriver = { - .name = "UML", - .vmFilterRebuild = umlVMFilterRebuild, - .vmDriverLock = umlVMDriverLock, - .vmDriverUnlock = umlVMDriverUnlock, -}; - int umlRegister(void) { virRegisterDriver(¨Driver); virRegisterStateDriver(¨StateDriver); - virNWFilterRegisterCallbackDriver(¨CallbackDriver); return 0; } -- 1.7.11.2

On 08/09/2012 12:30 AM, Laine Stump wrote:
The meat of this patch is just moving the calls to virNWFilterRegisterCallbackDriver from each hypervisor's "register" function into its "initialize" function. The rest is just code movement to allow that, and a new virNWFilterUnRegisterCallbackDriver function to undo what the register function does.
The long explanation:
<snip> but certainly helpful.
+++ b/src/conf/nwfilter_conf.c @@ -2829,6 +2829,24 @@ virNWFilterRegisterCallbackDriver(virNWFilterCallbackDriverPtr cbd) }
void +virNWFilterUnRegisterCallbackDriver(virNWFilterCallbackDriverPtr cbd) +{ + int i = 0; + + while (i < nCallbackDriver && callbackDrvArray[i] != cbd) + i++; + + if (i < nCallbackDriver) { + while (i < nCallbackDriver - 1) { + callbackDrvArray[i] = callbackDrvArray[i+1]; + i++; + }
Is memmove() better than an open-coded loop?
+++ b/src/libvirt_private.syms @@ -880,6 +880,7 @@ virNWFilterRuleActionTypeToString; virNWFilterRuleDirectionTypeToString; virNWFilterRuleProtocolTypeToString; virNWFilterTestUnassignDef; +virNWFilterUnRegisterCallbackDriver; virNWFilterUnlockFilterUpdates;
I don't know if we've been favoring case-sensitive ("C") or case-insensitive ("en_US.UTF-8") sorting in this file, so don't worry about whether you need to swap lines. I blame POSIX for introducing LC_COLLATE :) ACK. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 08/09/2012 04:08 PM, Eric Blake wrote:
On 08/09/2012 12:30 AM, Laine Stump wrote:
The meat of this patch is just moving the calls to virNWFilterRegisterCallbackDriver from each hypervisor's "register" function into its "initialize" function. The rest is just code movement to allow that, and a new virNWFilterUnRegisterCallbackDriver function to undo what the register function does.
The long explanation: <snip> but certainly helpful.
+++ b/src/conf/nwfilter_conf.c @@ -2829,6 +2829,24 @@ virNWFilterRegisterCallbackDriver(virNWFilterCallbackDriverPtr cbd) }
void +virNWFilterUnRegisterCallbackDriver(virNWFilterCallbackDriverPtr cbd) +{ + int i = 0; + + while (i < nCallbackDriver && callbackDrvArray[i] != cbd) + i++; + + if (i < nCallbackDriver) { + while (i < nCallbackDriver - 1) { + callbackDrvArray[i] = callbackDrvArray[i+1]; + i++; + } Is memmove() better than an open-coded loop?
Okay. it's not going to make any practical difference, but just to give the appearance of being optimized, I squashed in the following before pushing: diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index 4fbbc78..8f8e053 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c @@ -2837,10 +2837,8 @@ virNWFilterUnRegisterCallbackDriver(virNWFilterCallbackDriverPtr cbd) i++; if (i < nCallbackDriver) { - while (i < nCallbackDriver - 1) { - callbackDrvArray[i] = callbackDrvArray[i+1]; - i++; - } + memmove(&callbackDrvArray[i], &callbackDrvArray[i+1], + (nCallbackDriver - i - 1) * sizeof(callbackDrvArray[i])); callbackDrvArray[i] = 0; nCallbackDriver--; }
+++ b/src/libvirt_private.syms @@ -880,6 +880,7 @@ virNWFilterRuleActionTypeToString; virNWFilterRuleDirectionTypeToString; virNWFilterRuleProtocolTypeToString; virNWFilterTestUnassignDef; +virNWFilterUnRegisterCallbackDriver; virNWFilterUnlockFilterUpdates; I don't know if we've been favoring case-sensitive ("C") or case-insensitive ("en_US.UTF-8") sorting in this file, so don't worry about whether you need to swap lines. I blame POSIX for introducing LC_COLLATE :)
I couldn't decide whether or not to be case sensitive when adding this entry, but the thought at the top of my mind was "I'm *sure* Eric will say something about this!" :-) Thanks for the review. I squashed in the bit above and pushed it.

Le 09/08/2012 08:22, Laine Stump a écrit :
On 08/08/2012 12:40 PM, [Vo2Labs] Jean-Charles Passard wrote:
Hello,
At first a big thanks to Laine, who kindly tried to help me !
My problem is the following :
I use a linux from scratch distro ( home made) pure X86_64 glibc 2.10.1 gcc 4.4.1 uname -a SMP Sat Aug 4 20:07:49 CEST 2012 x86_64 x86_64 x86_64 GNU/Linux
Each time I use nwfilter-define, libvirtd crash with a segfault. I tried nearly all version from 0.9.8 to 0.9.13 and even 0.10 with the same problem Here is a sample of newfilter.xml :
<filter name='nova-base'> <filterref filter='no-ip-spoofing'/> </filter>
and here the bt unde gdb with v0.9.13
#0 __pthread_mutex_lock (mutex=0x0) at pthread_mutex_lock.c:50 #1 0x00007ffff77ba07e in virNWFilterCallbackDriversLock () at conf/nwfilter_conf.c:2846 I'm just doing a test build of a patch to fix this, and I'll send it as a reply to this message when I'm done. (It contains a full explanation of the cause of the crash).
Thanks for the complete bug report Jean Charles! This was fun to debug :-)
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Hello Laine,
Thank you very much for this great work ! I just tried your patch and it works great, no more problem. And if you'd fun it's 'la cerise sur le gateau', as we say in my country JC
participants (5)
-
[Vo2Labs] Jean-Charles Passard
-
Alex Jia
-
Eric Blake
-
Jean-Charles
-
Laine Stump