Bug 843716

Summary: The libvirtd deamon was killed abnormally when i destroy a domain which was in creating process
Product: Red Hat Enterprise Linux 6 Reporter: zhenfeng wang <zhwang>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.4CC: acathrow, dallan, dyasny, dyuan, gsun, hchiramm, mzhan, pkrempa, rhodain, ydu, zhwang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.10.0-0rc0.el6 Doc Type: Bug Fix
Doc Text:
Bug in previously added feature
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:20:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
domain xml none

Description zhenfeng wang 2012-07-27 07:09:24 UTC
Description of problem:
The libvirtd deamon was killed abnormally  when i destroy a domain which was  in creating process

Version-Release number of selected component (if applicable):
# rpm -qa|grep libvirt
libvirt-0.9.13-3.el6.x86_64
#rpm -qa|grep kvm
qemu-kvm-0.12.1.2-2.297.el6.x86_64
# uname -r
2.6.32-287.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1.# ps aux |grep libvirtd
root     30305  0.6  0.1 1029192 13836 ?       Sl   19:49   0:00 libvirtd --daemon
root     30615  0.0  0.0 103240   824 pts/3    S+   19:51   0:00 grep libvirtd
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 1     rhel6                          running

2.[terminal~A]# virsh create --console abc.xml
Domain rhel58 created from abc.xml
Connected to domain rhel58
Escape character is ^]
Memory for crash kernel (0x0 to 0x0) notwithin permissible range
WARNING calibrate_APIC_clock: the APIC timer calibration may be wrong.
PCI: PIIX3: Enabling Passive Release on 0000:00:01.0
Red Hat nash version 5.1.19.6 starting


3.destroy the creating domain at the same time
 [terminal~B]# virsh destroy rhel58
error: Failed to destroy domain rhel58
error: End of file while reading data: Input/output error

# virsh list --all
error: Failed to reconnect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused

# ps aux |grep libvirtd
root     29580  0.0  0.0 103240   820 pts/3    S+   19:42   0:00 grep libvirtd
  
Actual results:
the libvirtd deamon was killed abnormally

Expected results:
the libvirtd deamon should run normally and this operation should't affect other guest

Additional info:
abc.xml

Comment 2 Peter Krempa 2012-07-27 09:55:32 UTC
Could you please attach abc.xml that you used to create the machine.

Thanks.

Comment 3 zhenfeng wang 2012-07-27 10:02:48 UTC
Created attachment 600736 [details]
domain xml

Comment 4 Peter Krempa 2012-07-27 13:50:01 UTC
Fix posted upstream: http://www.redhat.com/archives/libvir-list/2012-July/msg01578.html

Comment 5 Peter Krempa 2012-07-30 13:45:22 UTC
Fixed upstream:

commit ba226d334acbc49f6751b430e0c4e00f69eef6bf
Author: Peter Krempa <pkrempa>
Date:   Fri Jul 27 14:50:54 2012 +0200

    conf: Remove callback from stream when freeing entries in console hash
    
    When a domain has a active console connection and is destroyed the
    callback is called on private data that no longer exist causing a
    segfault.

Moving to POST as RHEL will pick this up in a rebase.

Comment 7 yanbing du 2012-08-03 07:06:50 UTC
Test with libvirt-0.10.0-0rc0.el6.x86_64.
Just following the reproduce steps in comment 0, after destroy the creating guest, libvirtd not crash and work well. 
# service libvirtd status
libvirtd (pid  31964) is running...

# ps aux |grep libvirtd
root     31964  0.0  0.2 1037280 11072 ?       Sl   14:45   0:00 libvirtd --daemon
root     32203  0.0  0.0 103240   848 pts/0    S+   15:01   0:00 grep libvirtd

So move this bug to verify.

Comment 11 Peter Krempa 2012-10-16 07:28:38 UTC
*** Bug 866785 has been marked as a duplicate of this bug. ***

Comment 12 errata-xmlrpc 2013-02-21 07:20:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0276.html