qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] 9pfs is broken in 2.5 (SIGSEGV) (bisected)
Date: Sat, 19 Dec 2015 19:41:08 +0100	[thread overview]
Message-ID: <20151219194108.1744c5b4@bahia.local> (raw)
In-Reply-To: <5675208A.7090805@msgid.tls.msk.ru>

On Sat, 19 Dec 2015 12:16:58 +0300
Michael Tokarev <mjt@tls.msk.ru> wrote:

> 19.12.2015 11:15, Michael Tokarev wrote:
> >> commit ebac1202c95a4f1b76b6ef3f0f63926fa76e753e
> >> Author: Paolo Bonzini <pbonzini@redhat.com>
> >> Date:   Fri Nov 27 12:43:06 2015 +0100
> >>     virtio-9p: use QEMU thread pool
> > 
> > Program received signal SIGSEGV, Segmentation fault.
> > thread_pool_submit_aio (pool=0x0, func=0x55555580f6a0 <coroutine_enter_func>, arg=0x555557698870, cb=<optimized out>,
> >     opaque=<optimized out>) at /build/kvm/git/thread-pool.c:246
> > 246	    QLIST_INSERT_HEAD(&pool->head, req, all);
> > (gdb) bt
> > #0  thread_pool_submit_aio (pool=0x0, func=0x55555580f6a0 <coroutine_enter_func>, arg=0x555557698870, cb=<optimized out>,
> >     opaque=<optimized out>) at /build/kvm/git/thread-pool.c:246
> > #1  0x000055555592c9ed in aio_bh_call (bh=<optimized out>) at /build/kvm/git/async.c:64
> > #2  aio_bh_poll (ctx=ctx@entry=0x5555563c9360) at /build/kvm/git/async.c:92
> > #3  0x0000555555939390 in aio_dispatch (ctx=0x5555563c9360) at /build/kvm/git/aio-posix.c:305
> > #4  0x000055555592c7de in aio_ctx_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>)
> >     at /build/kvm/git/async.c:231
> > #5  0x00007ffff49d1c5d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> > #6  0x0000555555937cf8 in glib_pollfds_poll () at /build/kvm/git/main-loop.c:211
> > #7  os_host_main_loop_wait (timeout=<optimized out>) at /build/kvm/git/main-loop.c:256
> > #8  main_loop_wait (nonblocking=<optimized out>) at /build/kvm/git/main-loop.c:504
> > #9  0x00005555556dbe3e in main_loop () at /build/kvm/git/vl.c:1923
> > #10 main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at /build/kvm/git/vl.c:4684
> > (gdb) p pool
> > $2 = (ThreadPool *) 0x0
> 
> In 9pfs/virtio-9p-coth.c:co_run_in_worker_bh(), in this context:
> 
> void co_run_in_worker_bh(void *opaque)
> {
>     Coroutine *co = opaque;
>     thread_pool_submit_aio(qemu_get_aio_context()->thread_pool,
>                            coroutine_enter_func, co, coroutine_enter_cb, co);
> }
> 
> qemu_get_aio_context()->thread_pool is NULL.
> 
> Thanks,
> 
> /mjt
> 

Hi Michael,

It works-for-me-of-course on ppc64le and x86_64. I could verify with gdb that
thread_pool gets set early:

#0  aio_get_thread_pool (ctx=0x10e6b7a0)
    at /home/greg/Work/qemu/qemu-master/async.c:280
#1  0x00000000105e06fc in paio_submit (bs=0x10e8d1c0, fd=15, sector_num=0, 
    qiov=0x3fffffffe0e0, nb_sectors=1, cb=0x105f03e0 <bdrv_co_io_em_complete>, 
    opaque=0x3fffb6e2fc88, type=1)
    at /home/greg/Work/qemu/qemu-master/block/raw-posix.c:1309
#2  0x00000000105e08a0 in raw_aio_submit (bs=0x10e8d1c0, sector_num=0, 
    qiov=0x3fffffffe0e0, nb_sectors=1, cb=0x105f03e0 <bdrv_co_io_em_complete>, 
    opaque=0x3fffb6e2fc88, type=1)
    at /home/greg/Work/qemu/qemu-master/block/raw-posix.c:1339
#3  0x00000000105e0a98 in raw_aio_readv (bs=0x10e8d1c0, sector_num=0, 
    qiov=0x3fffffffe0e0, nb_sectors=1, cb=0x105f03e0 <bdrv_co_io_em_complete>, 
    opaque=0x3fffb6e2fc88)
    at /home/greg/Work/qemu/qemu-master/block/raw-posix.c:1377
#4  0x00000000105f055c in bdrv_co_io_em (bs=0x10e8d1c0, sector_num=0, 
    nb_sectors=1, iov=0x3fffffffe0e0, is_write=false)
    at /home/greg/Work/qemu/qemu-master/block/io.c:2300
#5  0x00000000105f0648 in bdrv_co_readv_em (bs=0x10e8d1c0, sector_num=0, 
    nb_sectors=1, iov=0x3fffffffe0e0)
    at /home/greg/Work/qemu/qemu-master/block/io.c:2317
#6  0x00000000105eba90 in bdrv_aligned_preadv (bs=0x10e8d1c0, 
    req=0x3fffb6e2fe48, offset=0, bytes=512, align=512, qiov=0x3fffffffe0e0, 
    flags=0) at /home/greg/Work/qemu/qemu-master/block/io.c:900
#7  0x00000000105ebfd4 in bdrv_co_do_preadv (bs=0x10e8d1c0, offset=0, 
    bytes=512, qiov=0x3fffffffe0e0, flags=(unknown: 0))
    at /home/greg/Work/qemu/qemu-master/block/io.c:992
#8  0x00000000105eaa28 in bdrv_rw_co_entry (opaque=0x3fffffffe040)
    at /home/greg/Work/qemu/qemu-master/block/io.c:534
#9  0x0000000010675bc4 in coroutine_trampoline (i0=283706576, i1=0)
    at /home/greg/Work/qemu/qemu-master/util/coroutine-ucontext.c:80
#10 0x00003fffb76c1c4c in makecontext () from /lib64/power8/libc.so.6

Probably other options on the command line make the difference. Anyway it
would seem we can reach co_run_in_worker_bh() without the main thread pool
being initialized... I'll work this out early next week.

Thanks.

--
Greg

      reply	other threads:[~2015-12-19 18:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-19  8:05 [Qemu-devel] 9pfs is broken in 2.5 (SIGSEGV) (bisected) Michael Tokarev
2015-12-19  8:15 ` Michael Tokarev
     [not found] ` <5675120F.3000904@tls.msk.ru>
2015-12-19  9:16   ` Michael Tokarev
2015-12-19 18:41     ` Greg Kurz [this message]

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=20151219194108.1744c5b4@bahia.local \
    --to=gkurz@linux.vnet.ibm.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).