Hi, On Mon, Jan 16, 2012 at 10:52:50AM +0100, Vlastimil Holer wrote: > Package: libvirt-bin > Version: 0.9.8-2~bpo60+2 > Severity: important > > > Virsh segfaults on connect to (at least) Xen hypervisor. > Gdb output attached below. Same connect to qemu:///session or > lxc:/// works fine. Older 0.9.2 from sq. backports worked fine > too, no configuration change was done. Could you check if the attached patch changes anything? If so there something wrong with capabilties detection. Cheers, -- Guido
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <a...@sigxcpu.org> Date: Fri, 20 Jan 2012 08:56:39 +0100 Subject: xen: Don't crash when we fail to init caps
--- src/xen/xen_hypervisor.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c index 96c851b..fc80d6f 100644 --- a/src/xen/xen_hypervisor.c +++ b/src/xen/xen_hypervisor.c @@ -2576,8 +2576,9 @@ xenHypervisorMakeCapabilitiesInternal(virConnectPtr conn, if (virStrncpy(hvm_type, &line[subs[1].rm_so], subs[1].rm_eo-subs[1].rm_so, - sizeof(hvm_type)) == NULL) - return NULL; + sizeof(hvm_type)) == NULL) { + goto no_memory; + } } else if (regexec (&flags_pae_rec, line, 0, NULL, 0) == 0) host_pae = 1; } @@ -2744,6 +2745,11 @@ xenHypervisorMakeCapabilities(virConnectPtr conn) cpuinfo, capabilities); + if (caps == NULL) { + VIR_WARN("Failed to get host capabilities"); + return NULL; + } + if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0) VIR_WARN("Failed to get host power management capabilities");