qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, quintela@redhat.com, alex.bennee@linaro.org
Subject: Re: [Qemu-devel] [PATCH] migration: Cleanup during exit
Date: Thu, 28 Feb 2019 14:28:03 +0800	[thread overview]
Message-ID: <20190228062803.GA7471@xz-x1> (raw)
In-Reply-To: <20190227164900.16378-1-dgilbert@redhat.com>

On Wed, Feb 27, 2019 at 04:49:00PM +0000, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> Currently we cleanup the migration object as we exit main after the
> main_loop finishes; however if there's a migration running things
> get messy and we can end up with the migration thread still trying
> to access freed structures.
> 
> We now take a ref to the object around the migration thread itself,
> so the act of dropping the ref during exit doesn't cause us to lose
> the state until the thread quits.
> 
> Cancelling the migration during migration also tries to get the thread
> to quit.
> 
> We do this a bit earlier; so hopefully migration gets out of the way
> before all the devices etc are freed.

So does it mean that even with the patch it's still possible the
migration thread will be accessing device structs that have already
been freed which can still crash QEMU?

Thanks,

-- 
Peter Xu

  parent reply	other threads:[~2019-02-28  6:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27 16:49 [Qemu-devel] [PATCH] migration: Cleanup during exit Dr. David Alan Gilbert (git)
2019-02-27 20:32 ` Juan Quintela
2019-02-28  6:28 ` Peter Xu [this message]
2019-02-28 11:40   ` Dr. David Alan Gilbert
2019-02-28 12:01     ` Daniel P. Berrangé
2019-02-28 12:28       ` Dr. David Alan Gilbert
2019-03-01  3:27         ` Peter Xu
2019-03-01 10:11           ` Dr. David Alan Gilbert
2019-03-04  7:52             ` Peter Xu
2019-02-28 10:49 ` Alex Bennée

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=20190228062803.GA7471@xz-x1 \
    --to=peterx@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@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).