Red Hat Bugzilla – Bug 994657
libvirtd gets segmentation violation trying to access recently freed virDomainDefPtr
Last modified: 2013-08-07 16:18:12 EDT
Description of problem:
When trying to create a domain (using virt-install or virt-manager), libvirtd gets a segmentation violation and exits.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
virt-install --name centos64 --ram 1024 -s 20 -f /dev/VolGroup00/lv_centos64 --location http://centralcity2.dr.avaya.com/centos64 --network bridge=avpublic
command exits with an exception: unexpected end of file while reading libvirtd's socket that was closed when libvirtd died from SIGSEGV.
libvirtd continues to create the domain and virt-install proceeds normally.
Here is the call sequence:
def = virDomainDefParseString -->
... call some other XML routines ...
virGetDomain(def) <-- def is no longer usable and we get SIGSEGV
I fixed this by not calling virDomainDefFree inside xenDaemonCreateXML:
- We will call virDomainDefFree from xenUnifiedDomainCreateXML after xenDaemonCraeteXML returns, anyway.
- We are passing def to virGetDomain and aren't done with it yet. This is where the SIGSEGV happens.
Can you post your patch upstream to firstname.lastname@example.org?
Already patched upstream for the upcoming 1.1.2 with this:
Author: Stefan Bader <email@example.com>
Date: Wed Jul 31 11:59:21 2013 +0200
xen: Avoid double free of virDomainDef in xenDaemonCreateXML
The virDomainDef is allocated by the caller and also used after
calling to xenDaemonCreateXML. So it must not get freed by the
Signed-off-by: Stefan Bader <firstname.lastname@example.org>