From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Laurent Vivier" <lvivier@redhat.com>,
"Corey Minyard" <cminyard@mvista.com>,
"Thomas Huth" <thuth@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Stefan Weil" <sw@weilnetz.de>,
"Jason Wang" <jasowang@redhat.com>,
"Juan Quintela" <quintela@redhat.com>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
qemu-arm <qemu-arm@nongnu.org>, qemu-ppc <qemu-ppc@nongnu.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Stefan Berger" <stefanb@linux.ibm.com>,
"Richard Henderson" <rth@twiddle.net>,
"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [PULL 00/28] Migration pull patches
Date: Mon, 13 Jan 2020 13:26:32 +0000 [thread overview]
Message-ID: <20200113132632.GD4033206@redhat.com> (raw)
In-Reply-To: <CAFEAcA97ZqynDV6b6YUL_7iF=zsmB2Mwogi0k4ViAUAFTwsTnA@mail.gmail.com>
On Mon, Jan 13, 2020 at 01:05:22PM +0000, Peter Maydell wrote:
> On Fri, 10 Jan 2020 at 17:32, Juan Quintela <quintela@redhat.com> wrote:
> >
> > The following changes since commit f38a71b01f839c7b65ea73ddd507903cb9489ed6:
> >
> > Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-semihosting-090120-2' into staging (2020-01-10 13:19:34 +0000)
> >
> > are available in the Git repository at:
> >
> > https://github.com/juanquintela/qemu.git tags/migration-pull-pull-request
> >
> > for you to fetch changes up to cc708d2411d3ed2ab4a428c996b778c7c7a47a04:
> >
> > apic: Use 32bit APIC ID for migration instance ID (2020-01-10 18:19:18 +0100)
> >
[snip]
> I also saw this on aarch32 host (more precisely, on the
> aarch32-environment-in-aarch64-chroot setup I use for aarch32 build
> and test):
>
> malloc_consolidate(): invalid chunk size
> Broken pipe
> qemu-system-i386: check_section_footer: Read section footer failed: -5
> qemu-system-i386: load of migration failed: Invalid argument
> /home/peter.maydell/qemu/tests/libqtest.c:140: kill_qemu() tried to
> terminate QEMU process but encountered exit status 1 (expected 0)
> Aborted
> ERROR - too few tests run (expected 14, got 13)
>
> The memory corruption is reproducible running just the
> /x86_64/migration/multifd/tcp subtest:
>
> (armhf)pmaydell@mustang-maydell:~/qemu/build/all-a32$
> QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64
> tests/migration-test -p /x86_64/migration/multifd/tcp
> /x86_64/migration/multifd/tcp: qemu-system-x86_64: -accel kvm: invalid
> accelerator kvm
> qemu-system-x86_64: falling back to tcg
> qemu-system-x86_64: -accel kvm: invalid accelerator kvm
> qemu-system-x86_64: falling back to tcg
> qemu-system-x86_64: multifd_send_sync_main: multifd_send_pages fail
> qemu-system-x86_64: failed to save SaveStateEntry with id(name): 3(ram)
> double free or corruption (!prev)
> Broken pipe
> qemu-system-x86_64: Unknown combination of migration flags: 0
> qemu-system-x86_64: error while loading state section id 3(ram)
> qemu-system-x86_64: load of migration failed: Invalid argument
> /home/peter.maydell/qemu/tests/libqtest.c:140: kill_qemu() tried to
> terminate QEMU process but encountered exit status 1 (expected 0)
> Aborted
>
> Here's what a valgrind run in that aarch32 setup produces:
>
> (armhf)pmaydell@mustang-maydell:~/qemu/build/all-a32$
> QTEST_QEMU_BINARY='valgrind --smc-check=all-non-file
> x86_64-softmmu/qemu-system-x86_64' tests/migration-test -p
> /x86_64/migration/multifd/tcp
> /x86_64/migration/multifd/tcp: ==12102== Memcheck, a memory error detector
> ==12102== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
> ==12102== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
> ==12102== Command: x86_64-softmmu/qemu-system-x86_64 -qtest
> unix:/tmp/qtest-12100.sock -qtest-log /dev/null -chardev
> socket,path=/tmp/qtest-12100.qmp,id=char0 -mon
> chardev=char0,mode=control -display none -accel kvm -accel tcg -name
> source,debug-threads=on -m 150M -serial
> file:/tmp/migration-test-UlotFX/src_serial -drive
> file=/tmp/migration-test-UlotFX/bootsect,format=raw -accel qtest
> ==12102==
> qemu-system-x86_64: -accel kvm: invalid accelerator kvm
> qemu-system-x86_64: falling back to tcg
> ==12108== Memcheck, a memory error detector
> ==12108== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
> ==12108== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
> ==12108== Command: x86_64-softmmu/qemu-system-x86_64 -qtest
> unix:/tmp/qtest-12100.sock -qtest-log /dev/null -chardev
> socket,path=/tmp/qtest-12100.qmp,id=char0 -mon
> chardev=char0,mode=control -display none -accel kvm -accel tcg -name
> target,debug-threads=on -m 150M -serial
> file:/tmp/migration-test-UlotFX/dest_serial -incoming defer -drive
> file=/tmp/migration-test-UlotFX/bootsect,format=raw -accel qtest
> ==12108==
> qemu-system-x86_64: -accel kvm: invalid accelerator kvm
> qemu-system-x86_64: falling back to tcg
> ==12102== Thread 22 multifdsend_15:
> ==12102== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s)
> ==12102== at 0x53C7F06: __libc_do_syscall (libc-do-syscall.S:47)
> ==12102== by 0x53C6FCB: sendmsg (sendmsg.c:28)
> ==12102== by 0x51B9A9: qio_channel_socket_writev (channel-socket.c:561)
> ==12102== by 0x519FCD: qio_channel_writev (channel.c:207)
> ==12102== by 0x519FCD: qio_channel_writev_all (channel.c:171)
> ==12102== by 0x51A047: qio_channel_write_all (channel.c:257)
> ==12102== by 0x25CB17: multifd_send_initial_packet (ram.c:714)
> ==12102== by 0x25CB17: multifd_send_thread (ram.c:1136)
> ==12102== by 0x557551: qemu_thread_start (qemu-thread-posix.c:519)
> ==12102== by 0x53BE613: start_thread (pthread_create.c:463)
> ==12102== by 0x54767FB: ??? (clone.S:73)
> ==12102== Address 0x262103fd is on thread 22's stack
> ==12102== in frame #5, created by multifd_send_thread (ram.c:1127)
Missing initialization of MultiFDInit_t msg; to all zeros
> ==12102==
> ==12102== Thread 6 multifdsend_1:
> ==12102== Invalid write of size 4
> ==12102== at 0x25CC08: multifd_send_fill_packet (ram.c:806)
> ==12102== by 0x25CC08: multifd_send_thread (ram.c:1157)
> ==12102== by 0x557551: qemu_thread_start (qemu-thread-posix.c:519)
> ==12102== by 0x53BE613: start_thread (pthread_create.c:463)
> ==12102== by 0x54767FB: ??? (clone.S:73)
> ==12102== Address 0x1d89c470 is 0 bytes after a block of size 832 alloc'd
> ==12102== at 0x4841BC4: calloc (vg_replace_malloc.c:711)
> ==12102== by 0x49EE269: g_malloc0 (in
> /usr/lib/arm-linux-gnueabihf/libglib-2.0.so.0.5600.4)
This is the same issue that was reported last time this mulitfd unit
test was proposed for merge. Back then I pointed out the likely cause.
We were allocating ram_addr_t sized quantity for an array which is
uint64_t, and ram_addr_t is probably 32-bit on this particular build.
https://lists.gnu.org/archive/html/qemu-devel/2019-07/msg03428.html
That suggested fix doesn't seem to have been included
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2020-01-13 13:28 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 17:31 [PULL 00/28] Migration pull patches Juan Quintela
2020-01-10 17:31 ` [PULL 01/28] migration-test: Add migration multifd test Juan Quintela
2020-01-10 17:31 ` [PULL 02/28] migration: Make sure that we don't call write() in case of error Juan Quintela
2020-01-10 17:31 ` [PULL 03/28] migration-test: introduce functions to handle string parameters Juan Quintela
2020-01-10 17:31 ` [PULL 04/28] migration-test: ppc64: fix FORTH test program Juan Quintela
2020-01-10 17:31 ` [PULL 05/28] runstate: ignore finishmigrate -> prelaunch transition Juan Quintela
2020-01-10 17:31 ` [PULL 06/28] ram.c: remove unneeded labels Juan Quintela
2020-01-10 17:31 ` [PULL 07/28] migration: Rate limit inside host pages Juan Quintela
2020-01-10 17:31 ` [PULL 08/28] migration: Support QLIST migration Juan Quintela
2020-01-10 17:31 ` [PULL 09/28] migration: Fix incorrect integer->float conversion caught by clang Juan Quintela
2020-01-10 17:31 ` [PULL 10/28] migration: Fix the re-run check of the migrate-incoming command Juan Quintela
2020-01-10 17:31 ` [PULL 11/28] misc: use QEMU_IS_ALIGNED Juan Quintela
2020-01-10 17:31 ` [PULL 12/28] migration: add savevm_state_handler_remove() Juan Quintela
2020-01-10 17:32 ` [PULL 13/28] migration: savevm_state_handler_insert: constant-time element insertion Juan Quintela
2020-01-10 17:32 ` [PULL 14/28] migration/ram: Yield periodically to the main loop Juan Quintela
2020-01-10 17:32 ` [PULL 15/28] migration/postcopy: reduce memset when it is zero page and matches_target_page_size Juan Quintela
2020-01-10 17:32 ` [PULL 16/28] migration/postcopy: wait for decompress thread in precopy Juan Quintela
2020-01-10 17:32 ` [PULL 17/28] migration/postcopy: count target page number to decide the place_needed Juan Quintela
2020-01-10 17:32 ` [PULL 18/28] migration/postcopy: set all_zero to true on the first target page Juan Quintela
2020-01-10 17:32 ` [PULL 19/28] migration/postcopy: enable random order target page arrival Juan Quintela
2020-01-10 17:32 ` [PULL 20/28] migration/postcopy: enable compress during postcopy Juan Quintela
2020-01-10 17:32 ` [PULL 21/28] migration/multifd: clean pages after filling packet Juan Quintela
2020-01-10 17:32 ` [PULL 22/28] migration/multifd: not use multifd during postcopy Juan Quintela
2020-01-10 17:32 ` [PULL 23/28] migration/multifd: fix nullptr access in terminating multifd threads Juan Quintela
2020-01-10 17:32 ` [PULL 24/28] migration/multifd: fix destroyed mutex " Juan Quintela
2020-01-10 17:32 ` [PULL 25/28] Bug #1829242 correction Juan Quintela
2020-01-10 17:32 ` [PULL 26/28] migration: Define VMSTATE_INSTANCE_ID_ANY Juan Quintela
2020-01-10 17:32 ` [PULL 27/28] migration: Change SaveStateEntry.instance_id into uint32_t Juan Quintela
2020-01-10 17:32 ` [PULL 28/28] apic: Use 32bit APIC ID for migration instance ID Juan Quintela
2020-01-13 13:05 ` [PULL 00/28] Migration pull patches Peter Maydell
2020-01-13 13:26 ` Daniel P. Berrangé [this message]
2020-01-13 14:53 ` Juan Quintela
2020-01-13 13:50 ` Auger Eric
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200113132632.GD4033206@redhat.com \
--to=berrange@redhat.com \
--cc=cminyard@mvista.com \
--cc=david@gibson.dropbear.id.au \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=jasowang@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=quintela@redhat.com \
--cc=rth@twiddle.net \
--cc=stefanb@linux.ibm.com \
--cc=sw@weilnetz.de \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).