Red Hat Bugzilla – Bug 822068
libvirtd will crash when hotplug attah-disk to guest
Last modified: 2013-10-20 17:45:35 EDT
Description of problem: libvirtd will crash when attah-disk to guest Version-Release number of selected component (if applicable): libvirt-0.9.11.3-1.el7.x86_64 qemu-kvm-1.0-17.1.el7.x86_64 How reproducible: 90% Steps to Reproduce: 1. virsh attach-disk copy /dev/sda1 vda error: Failed to attach disk error: End of file while reading data: Input/output error [root@intel-q9400-4-7 tmp]# virsh list error: Failed to reconnect to the hypervisor error: no valid connection error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused Actual results: attach disk will crash libvirtd Expected results: attach disk successfully and libvirtd is alive Additional info: I will attach libvirtd debug log when it crash
Created attachment 584905 [details] libvirtd crash log
Hi Huang, could you please provide a full backtrace of the crashed daemon? I'm not able to reproduce this. Peter
Created attachment 585716 [details] gdb backtrace Hi,Peter I attached the gdb all backtrace ,thanks . Wenlong
Fixed upstream: commit 0f4660c8787cc41fe67f869984c0ae11d680037e Author: Peter Krempa <pkrempa@redhat.com> Date: Thu Jun 14 10:29:36 2012 +0200 qemu: Fix off-by-one error while unescaping monitor strings While unescaping the commands the commands passed through to the monitor function qemuMonitorUnescapeArg() initialized lenght of the input string to strlen()+1 which is fine for alloc but not for iteration of the string. This patch fixes the off-by-one error and drops the pointless check for a single trailing slash that is automaticaly handled by the default branch of switch.
I can reproduce this with: libvirt-0.9.11.3-1.el7.x86_64 qemu-kvm-1.0-17.1.el7.x86_64 verify with: libvirt-0.9.13-3.el6.x86_64 step: 1: run cmd: #for i in {a..z}; do virsh attach-disk $guest_name /dev/zero vd$i; done error: Failed to attach disk error: operation failed: target vda already exists Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully Disk attached successfully error: Failed to attach disk error: internal error No more available PCI addresses #virsh list --all Id Name State ---------------------------------------------------- 3 rhel6.3rcqcow2 running - rhel6.3c shut off - rhel6.3rc shut off - rhel6u2 shut off libvirt not crash, verification passed.
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