Bug 1043366

Summary: storage migration command "migrate -d -b -i tcp:des-ip:port" cause qemu-kvm core dump on source host
Product: Red Hat Enterprise Linux 6 Reporter: FuXiangChun <xfu>
Component: qemu-kvmAssignee: Dr. David Alan Gilbert <dgilbert>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 6.5CC: acathrow, bsarathy, dgilbert, juzhang, michen, mkenneth, qzhang, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-04 16:53:23 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:

Description FuXiangChun 2013-12-16 05:47:27 UTC
Description of problem:
Boot two guest in the same hosts, one of them is listening status. try to do storage migration in local. e.g 
migrate -b -i tcp:localhost:port - qemu-kvm works well.
migrate -d -b -i tcp:localhost:port  -qemu-kvm cored dump

so "-d" option cann't used with "-b" "-i" option.

Version-Release number of selected component (if applicable):
rhel6 host:
qemu-kvm-rhev-0.12.1.2-2.415.el6.x86_64
# uname -r
2.6.32-431.1.2.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.In src host
/usr/libexec/qemu-kvm -M rhel6.5.0 -enable-kvm -m 4096 -smp 2,sockets=2,cores=1,threads=1 -usb -device usb-tablet,id=input0 -name gpu -uuid 990ea161-6b67-47b2-b803-19fb01d30d30 -rtc base=localtime,clock=host,driftfix=slew -drive file=/root/des.raw,if=none,id=drive-virtio-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,vectors=0,bus=pci.0,addr=0x4,scsi=off,drive=drive-virtio-disk,id=virtio-disk,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device rtl8139,netdev=hostnet0,id=virtio-net-pci0,mac=00:01:02:B6:40:23,bus=pci.0,addr=0x5 -k en-us -boot menu=on -qmp tcp:0:4445,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :3 -monitor stdio 

2.In des host
# /usr/libexec/qemu-kvm -M rhel6.5.0 -enable-kvm -m 4096 -smp 2,sockets=2,cores=1,threads=1 -usb -device usb-tablet,id=input0 -name gpu -uuid 990ea161-6b67-47b2-b803-19fb01d30d30 -rtc base=localtime,clock=host,driftfix=slew -drive file=/root/des.raw,if=none,id=drive-virtio-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,vectors=0,bus=pci.0,addr=0x4,scsi=off,drive=drive-virtio-disk,id=virtio-disk,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device rtl8139,netdev=hostnet0,id=virtio-net-pci0,mac=00:01:02:B6:40:23,bus=pci.0,addr=0x5 -k en-us -boot menu=on -qmp tcp:0:4445,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :3 -monitor stdio -incoming tcp:0:5555

3.do storage migration
(qemu) migrate -d -b -i tcp:localhost:5555

Actual results:
Program received signal SIGSEGV, Segmentation fault.
monitor_flush (mon=0x0) at /usr/src/debug/qemu-kvm-0.12.1.2/monitor.c:283
283	    buf = qstring_get_str(mon->outbuf);
Missing separate debuginfos, use: debuginfo-install alsa-lib-1.0.22-3.el6.x86_64 celt051-0.5.1.3-0.el6.x86_64 cyrus-sasl-lib-2.1.23-13.el6_3.1.x86_64 cyrus-sasl-md5-2.1.23-13.el6_3.1.x86_64 cyrus-sasl-plain-2.1.23-13.el6_3.1.x86_64 db4-4.7.25-18.el6_4.x86_64 dbus-libs-1.2.24-7.el6_3.x86_64 flac-1.2.1-6.1.el6.x86_64 glib2-2.26.1-3.el6.x86_64 glibc-2.12-1.132.el6.x86_64 glusterfs-api-3.4.0.36rhs-1.el6.x86_64 glusterfs-libs-3.4.0.36rhs-1.el6.x86_64 gnutls-2.8.5-10.el6_4.2.x86_64 keyutils-libs-1.4-4.el6.x86_64 krb5-libs-1.10.3-10.el6_4.6.x86_64 libICE-1.0.6-1.el6.x86_64 libSM-1.2.1-2.el6.x86_64 libX11-1.5.0-4.el6.x86_64 libXau-1.0.6-4.el6.x86_64 libXext-1.3.1-2.el6.x86_64 libXi-1.6.1-3.el6.x86_64 libXtst-1.2.1-2.el6.x86_64 libaio-0.3.107-10.el6.x86_64 libasyncns-0.8-1.1.el6.x86_64 libcom_err-1.41.12-18.el6.x86_64 libgcrypt-1.4.5-11.el6_4.x86_64 libgpg-error-1.7-4.el6.x86_64 libjpeg-turbo-1.2.1-1.el6.x86_64 libogg-1.1.4-2.1.el6.x86_64 libselinux-2.0.94-5.3.el6_4.1.x86_64 libsndfile-1.0.20-5.el6.x86_64 libtasn1-2.3-3.el6_2.1.x86_64 libuuid-2.17.2-12.14.el6.x86_64 libvorbis-1.2.3-4.el6_2.1.x86_64 libxcb-1.8.1-1.el6.x86_64 nss-softokn-freebl-3.14.3-9.el6.x86_64 openssl-1.0.1e-15.el6.x86_64 pulseaudio-libs-0.9.21-14.el6_3.x86_64 spice-server-0.12.4-6.el6.x86_64 tcp_wrappers-libs-7.6-57.el6.x86_64 zlib-1.2.3-29.el6.x86_64
(gdb) bt
#0  monitor_flush (mon=0x0) at /usr/src/debug/qemu-kvm-0.12.1.2/monitor.c:283
#1  0x00007ffff7e59d2a in blk_mig_save_bulked_block (mon=0x0, f=0x7ffff9b94c50, is_async=1)
    at /usr/src/debug/qemu-kvm-0.12.1.2/block-migration.c:296
#2  0x00007ffff7e59f9f in block_save_live (mon=0x0, f=0x7ffff9b94c50, stage=1, opaque=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.12.1.2/block-migration.c:446
#3  0x00007ffff7e5447b in qemu_savevm_state_begin (mon=0x0, f=0x7ffff9b94c50, blk_enable=<value optimized out>, 
    shared=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/savevm.c:1556
#4  0x00007ffff7e4ab3f in migrate_fd_connect (s=0x7ffff8784770) at /usr/src/debug/qemu-kvm-0.12.1.2/migration.c:432
#5  0x00007ffff7e4c01a in wait_for_connect (opaque=0x7ffff8784d00) at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-sockets.c:259
#6  0x00007ffff7dc14d6 in main_loop_wait (timeout=1000) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4058
#7  0x00007ffff7de44ba in kvm_main_loop () at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-kvm.c:2245
#8  0x00007ffff7dc4349 in main_loop (argc=37, argv=<value optimized out>, envp=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4266
#9  main (argc=37, argv=<value optimized out>, envp=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:6644
(gdb)

Expected results:
give a friendly warning message. and qemu-kvm shouldn't core dump

Additional info:

Comment 2 Dr. David Alan Gilbert 2014-01-31 16:36:59 UTC
This looks like it should be fixed by Luiz's:

https://lists.gnu.org/archive/html/qemu-devel/2012-03/msg01555.html

that's upstream and in RHEL7.

Bit of a big set of changes though.

Comment 5 Dr. David Alan Gilbert 2014-02-04 16:53:23 UTC
acathrow says rhev doesn't normally use -b, so in that case given this is the same as 1015979 I'll dupe to it.

*** This bug has been marked as a duplicate of bug 1015979 ***

Comment 6 Qunfang Zhang 2014-02-07 03:35:12 UTC
(In reply to Dr. David Alan Gilbert from comment #5)
> acathrow says rhev doesn't normally use -b, so in that case given this is
> the same as 1015979 I'll dupe to it.
> 
> *** This bug has been marked as a duplicate of bug 1015979 ***

Hi, Dr. David

I think xfu created this bug because when adding both "-b" and "-i", it gets core dump. Although we will only use one option usually (-b or -i) but core dump is not friendly from user's point of view. And in bug 1015979, either -b or -i will fail. 

Hi, Xiangchun

Bug 1015979 is fixed in qemu-kvm-0.12.1.2-2.419.el6, could you help confirm this bz on the latest rhel6.6 qemu-kvm? If it's still reproduced, we could re-open this bug.

Thanks,
Qunfang

Comment 7 FuXiangChun 2014-02-07 08:31:51 UTC
According to comment0,Re-tested this bug with qemu-kvm-0.12.1.2-2.420.el6.x86_64. 

Result: 1. migration can be finished.  2. qemu-kvm works well in src host. 3. guest works well in des host.  so this bug is fixed.