qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Stefan Priebe <s.priebe@profihost.ag>
Cc: "famz@redhat.com" <famz@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	"qemu-stable@nongnu.org" <qemu-stable@nongnu.org>
Subject: Re: [Qemu-devel] qemu 2.0 segfaults in event notifier
Date: Mon, 2 Jun 2014 15:40:07 +0200	[thread overview]
Message-ID: <20140602134007.GG3049@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <606EBA1F-638A-487D-8551-8D183D79937E@profihost.ag>

On Fri, May 30, 2014 at 04:10:39PM +0200, Stefan Priebe wrote:
> even with
> +From 271c0f68b4eae72691721243a1c37f46a3232d61 Mon Sep 17 00:00:00 2001
> +From: Fam Zheng <famz@redhat.com>
> +Date: Wed, 21 May 2014 10:42:13 +0800
> +Subject: [PATCH] aio: Fix use-after-free in cancellation path
> 
> applied i saw today segfault with the following backtrace:
> 
> Program terminated with signal 11, Segmentation fault.
> #0  0x00007f9dd633343f in event_notifier_set (e=0x124) at util/event_notifier-posix.c:97
> 97      util/event_notifier-posix.c: No such file or directory.
> (gdb) bt
> #0  0x00007f9dd633343f in event_notifier_set (e=0x124) at util/event_notifier-posix.c:97
> #1  0x00007f9dd5f4eafc in aio_notify (ctx=0x0) at async.c:246
> #2  0x00007f9dd5f4e697 in qemu_bh_schedule (bh=0x7f9b98eeeb30) at async.c:128
> #3  0x00007f9dd5fa2c44 in rbd_finish_aiocb (c=0x7f9dd9069ad0, rcb=0x7f9dd85f1770) at block/rbd.c:585

Hi Stefan,
Please print the QEMUBH:
(gdb) p *(QEMUBH*)0x7f9b98eeeb30

It would also be interesting to print out the qemu_aio_context->first_bh
linked list of QEMUBH structs to check whether 0x7f9b98eeeb30 is on the
list.

The aio_bh_new() and aio_bh_schedule() APIs are supposed to be
thread-safe.  In theory the rbd.c code is fine.  But maybe there is a
race condition somewhere.

If you want to debug interactively, ping me on #qemu on irc.oftc.net.

Stefan

       reply	other threads:[~2014-06-02 13:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <53863BC6.3040108@profihost.ag>
     [not found] ` <53863C9A.4040905@profihost.ag>
     [not found]   ` <606EBA1F-638A-487D-8551-8D183D79937E@profihost.ag>
2014-06-02 13:40     ` Stefan Hajnoczi [this message]
2014-06-02 14:22       ` [Qemu-devel] qemu 2.0 segfaults in event notifier Stefan Priebe - Profihost AG
2014-06-02 19:32       ` Stefan Priebe
2014-06-02 20:45         ` Paolo Bonzini
2014-06-02 20:57           ` Stefan Priebe
2014-06-03  9:14         ` Stefan Hajnoczi

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=20140602134007.GG3049@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=s.priebe@profihost.ag \
    /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).