Received: from eggs.gnu.org ([2001:4830:134:3::10]:40825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAMRW-0003SD-1t for qemu-devel@nongnu.org; Sat, 19 Dec 2015 13:41:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAMRS-0002ej-Q6 for qemu-devel@nongnu.org; Sat, 19 Dec 2015 13:41:21 -0500 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:37508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAMRS-0002ea-H3 for qemu-devel@nongnu.org; Sat, 19 Dec 2015 13:41:18 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 19 Dec 2015 18:41:16 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id A154A2190046 for ; Sat, 19 Dec 2015 18:41:04 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tBJIfDiP10813756 for ; Sat, 19 Dec 2015 18:41:13 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tBJHfE2c004766 for ; Sat, 19 Dec 2015 10:41:14 -0700 Date: Sat, 19 Dec 2015 19:41:08 +0100 From: Greg Kurz Message-ID: <20151219194108.1744c5b4@bahia.local> In-Reply-To: <5675208A.7090805@msgid.tls.msk.ru> References: <56750FBC.6020106@msgid.tls.msk.ru> <5675120F.3000904@tls.msk.ru> <5675208A.7090805@msgid.tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] 9pfs is broken in 2.5 (SIGSEGV) (bisected) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: Paolo Bonzini , qemu-devel , "Aneesh Kumar K.V" On Sat, 19 Dec 2015 12:16:58 +0300 Michael Tokarev wrote: > 19.12.2015 11:15, Michael Tokarev wrote: > >> commit ebac1202c95a4f1b76b6ef3f0f63926fa76e753e > >> Author: Paolo Bonzini > >> 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 , arg=0x555557698870, cb=, > > opaque=) 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 , arg=0x555557698870, cb=, > > opaque=) at /build/kvm/git/thread-pool.c:246 > > #1 0x000055555592c9ed in aio_bh_call (bh=) 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=, callback=, user_data=) > > 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=) at /build/kvm/git/main-loop.c:256 > > #8 main_loop_wait (nonblocking=) at /build/kvm/git/main-loop.c:504 > > #9 0x00005555556dbe3e in main_loop () at /build/kvm/git/vl.c:1923 > > #10 main (argc=, argv=, envp=) 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 , 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 , 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 , 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