Received: from eggs.gnu.org ([208.118.235.92]:54738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USXl6-0002Ln-3b for qemu-devel@nongnu.org; Wed, 17 Apr 2013 15:11:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USXl4-0002j3-K9 for qemu-devel@nongnu.org; Wed, 17 Apr 2013 15:11:08 -0400 Received: from indium.canonical.com ([91.189.90.7]:45269) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USXl4-0002iq-BK for qemu-devel@nongnu.org; Wed, 17 Apr 2013 15:11:06 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1USXl3-000385-Fq for ; Wed, 17 Apr 2013 19:11:05 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 7257A2E8325 for ; Wed, 17 Apr 2013 19:11:05 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 17 Apr 2013 19:03:33 -0000 From: Lucas Meneghel Rodrigues Sender: bounces@canonical.com References: <20130416011019.20493.59957.malonedeb@gac.canonical.com> Message-Id: <20130417190333.27458.25600.malone@wampee.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1169375] Re: qemu.git master -> qemu segfaults during tcp migration (and other modes when using MALLOC_PERTURB_=1) Reply-To: Bug 1169375 <1169375@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Problem fixed with this commit, recently pushed to master: commit 7dda5dc82a776a39a7996020c188eb2a29187117 Author: Paolo Bonzini Date: Tue Apr 9 17:43:43 2013 +0200 migration: initialize RAM to zero = Using qemu_memalign only leaves the RAM zero by chance, because libc will usually use mmap to satisfy our huge requests. But memory will not be zero when using MALLOC_PERTURB_ with a nonzero value. In the case of incoming migration, this breaks a recently-introduced invariant (commit f1c7279, migration: do not sent zero pages in bulk stage, 2013-03-26). = To fix this, use mmap ourselves to get a well-aligned, always zero block for the RAM. Mmap-ed memory is easy to "trim" at the sides. = This also removes the need to do something special on valgrind (see commit c2a8238a, Support running QEMU on Valgrind, 2011-10-31), thus effectively reverts that patch. = Reviewed-by: Juan Quintela Signed-off-by: Paolo Bonzini Reviewed-by: Markus Armbruster Message-id: 1365522223-20153-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori I'll take the opportunity and also make MALLOC_PERTURB_=3D1 as default on virt-tests. This will help to avoid such regressions in the future. ** Changed in: qemu Status: New =3D> Fix Committed -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1169375 Title: qemu.git master -> qemu segfaults during tcp migration (and other modes when using MALLOC_PERTURB_=3D1) Status in QEMU: Fix Committed Bug description: Relevant qemu.git master commit: 24a6e7f4d91e9ed5f8117ecb083431a23f8609a0 When trying to migrate a VM using the TCP protocol, a segfault happened: 21:45:07 INFO | Running qemu command (reformatted): /home/lmr/Code/qemu/x86_64-softmmu/qemu-system-x86_64 \ -S \ -name 'virt-tests-vm1' \ -nodefaults \ -chardev socket,id=3Dhmp_id_hmp1,path=3D/tmp/monitor-hmp1-20130415-21= 4507-8fDeX7Fj,server,nowait \ -mon chardev=3Dhmp_id_hmp1,mode=3Dreadline \ -chardev socket,id=3Dserial_id_serial1,path=3D/tmp/serial-serial1-201= 30415-214507-8fDeX7Fj,server,nowait \ -device isa-serial,chardev=3Dserial_id_serial1 \ -chardev socket,id=3Dseabioslog_id_20130415-214507-8fDeX7Fj,path=3D/t= mp/seabios-20130415-214507-8fDeX7Fj,server,nowait \ -device isa-debugcon,chardev=3Dseabioslog_id_20130415-214507-8fDeX7Fj= ,iobase=3D0x402 \ -device ich9-usb-uhci1,id=3Dusb1 \ -drive file=3D'/home/lmr/Code/virt-test.git/shared/data/images/jeos-1= 7-64.qcow2',if=3Dnone,id=3Dvirtio0 \ -device virtio-blk-pci,drive=3Dvirtio0,bootindex=3D1 \ -device virtio-net-pci,netdev=3Didr5RNof,mac=3D'9a:42:43:44:45:46',id= =3D'idJVlBu3' \ -netdev user,id=3Didr5RNof,hostfwd=3Dtcp::5000-:22 \ -m 1024 \ -smp 2,maxcpus=3D2,cores=3D1,threads=3D1,sockets=3D2 \ -cpu 'SandyBridge' \ -M pc \ -device usb-tablet,id=3Dusb-tablet1,bus=3Dusb1.0,port=3D1 \ -vnc :1 \ -vga std \ -rtc base=3Dutc,clock=3Dhost,driftfix=3Dnone \ -boot order=3Dcdn,once=3Dc,menu=3Doff \ -enable-kvm \ -incoming tcp:0:5200 21:45:08 INFO | [qemu output] qemu-system-x86_64: -device usb-tablet,id= =3Dusb-tablet1,bus=3Dusb1.0,port=3D1: Bus 'virtio-pci-bus.0' is full 21:45:08 DEBUG| VM appears to be alive with PID 2002 21:45:08 DEBUG| (monitor hmp1) Sending command 'info cpus' = 21:45:08 DEBUG| (monitor hmp1) Response to 'info cpus' 21:45:08 DEBUG| (monitor hmp1) * CPU #0: pc=3D0x00000000fffffff0 threa= d_id=3D2004 21:45:08 DEBUG| (monitor hmp1) CPU #1: pc=3D0x00000000fffffff0 threa= d_id=3D2005 21:45:09 DEBUG| (monitor hmp1) Sending command 'cont' = 21:45:09 INFO | Migrating to tcp:0:5200 21:45:09 DEBUG| (monitor hmp1) Sending command 'migrate -d tcp:0:5200' = 21:45:10 WARNI| Could not find (qemu) prompt after command 'screendump /d= ev/shm/scrdump-MDE7wl.ppm'. Output so far: '' 21:45:10 WARNI| VM 'virt-tests-vm1' produced an invalid screendump 21:45:10 INFO | [qemu output] qemu: warning: error while loading state se= ction id 3 21:45:10 INFO | [qemu output] load of migration failed 21:45:10 INFO | [qemu output] /bin/sh: line 1: 1867 Segmentation fault = /home/lmr/Code/qemu/x86_64-softmmu/qemu-system-x86_64 -S -name 'virt-te= sts-vm1' -nodefaults -chardev socket,id=3Dhmp_id_hmp1,path=3D/tmp/monitor-h= mp1-20130415-214454-pGmRwNvs,server,nowait -mon chardev=3Dhmp_id_hmp1,mode= =3Dreadline -chardev socket,id=3Dserial_id_serial1,path=3D/tmp/serial-seria= l1-20130415-214454-pGmRwNvs,server,nowait -device isa-serial,chardev=3Dseri= al_id_serial1 -chardev socket,id=3Dseabioslog_id_20130415-214454-pGmRwNvs,p= ath=3D/tmp/seabios-20130415-214454-pGmRwNvs,server,nowait -device isa-debug= con,chardev=3Dseabioslog_id_20130415-214454-pGmRwNvs,iobase=3D0x402 -device= ich9-usb-uhci1,id=3Dusb1 -drive file=3D'/home/lmr/Code/virt-test.git/share= d/data/images/jeos-17-64.qcow2',if=3Dnone,id=3Dvirtio0 -device virtio-blk-p= ci,drive=3Dvirtio0,bootindex=3D1 -device virtio-net-pci,netdev=3Did33wvth,m= ac=3D'9a:42:43:44:45:46',id=3D'idavPVhj' -netdev user,id=3Did33wvth,hostfwd= =3Dtcp::5001-:22 -m 1024 -smp 2,maxcpus=3D2,cores=3D1,threads=3D1,so: We've missed those problems during the last couple of weeks due to problems in our test grid. The problem can be seen running the default test set on virt-test. By default, virt-test does not use MALLOC_PERTURB_=3D1. When using MALLOC_PERTURB_=3D1, pretty much all migration modes will fail. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1169375/+subscriptions