qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] fix the co_queue multi-adding bug
@ 2015-02-07  9:51 w00214312
  2015-02-07  9:51 ` [Qemu-devel] [PATCH] qemu-coroutine-lock: fix " w00214312
  2015-02-09  9:23 ` [Qemu-devel] [PATCH] fix the " Paolo Bonzini
  0 siblings, 2 replies; 10+ messages in thread
From: w00214312 @ 2015-02-07  9:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, famz, Bin Wu, stefanha

From: Bin Wu <wu.wubin@huawei.com>

When we test the drive_mirror between different hosts by ndb devices, 
we find that, during the cancel phase the qemu process crashes sometimes.
By checking the crash core file, we find the stack as follows, which means
a coroutine re-enter error occurs:

(gdb) bt
#0  0x00007fdfc744d885 in raise () from /lib64/libc.so.6
#1  0x00007fdfc744ee61 in abort () from /lib64/libc.so.6
#2  0x00007fdfca467cc5 in qemu_coroutine_enter (co=0x7fdfcaedb400, opaque=0x0)
at qemu-coroutine.c:118
#3  0x00007fdfca467f6c in qemu_co_queue_run_restart (co=0x7fdfcaedb400) at
qemu-coroutine-lock.c:59
#4  0x00007fdfca467be5 in coroutine_swap (from=0x7fdfcaf3c4e8,
to=0x7fdfcaedb400) at qemu-coroutine.c:96
#5  0x00007fdfca467cea in qemu_coroutine_enter (co=0x7fdfcaedb400, opaque=0x0)
at qemu-coroutine.c:123
#6  0x00007fdfca467f6c in qemu_co_queue_run_restart (co=0x7fdfcaedbdc0) at
qemu-coroutine-lock.c:59
#7  0x00007fdfca467be5 in coroutine_swap (from=0x7fdfcaf3c4e8,
to=0x7fdfcaedbdc0) at qemu-coroutine.c:96
#8  0x00007fdfca467cea in qemu_coroutine_enter (co=0x7fdfcaedbdc0, opaque=0x0)
at qemu-coroutine.c:123
#9  0x00007fdfca4a1fa4 in nbd_recv_coroutines_enter_all (s=0x7fdfcaef7dd0) at
block/nbd-client.c:41
#10 0x00007fdfca4a1ff9 in nbd_teardown_connection (client=0x7fdfcaef7dd0) at
block/nbd-client.c:50
#11 0x00007fdfca4a20f0 in nbd_reply_ready (opaque=0x7fdfcaef7dd0) at
block/nbd-client.c:92
#12 0x00007fdfca45ed80 in aio_dispatch (ctx=0x7fdfcae15e90) at aio-posix.c:144
#13 0x00007fdfca45ef1b in aio_poll (ctx=0x7fdfcae15e90, blocking=false) at
aio-posix.c:222
#14 0x00007fdfca448c34 in aio_ctx_dispatch (source=0x7fdfcae15e90, callback=0x0,
user_data=0x0) at async.c:212
#15 0x00007fdfc8f2f69a in g_main_context_dispatch () from
/usr/lib64/libglib-2.0.so.0
#16 0x00007fdfca45c391 in glib_pollfds_poll () at main-loop.c:190
#17 0x00007fdfca45c489 in os_host_main_loop_wait (timeout=1483677098) at
main-loop.c:235
#18 0x00007fdfca45c57b in main_loop_wait (nonblocking=0) at main-loop.c:484
#19 0x00007fdfca25f403 in main_loop () at vl.c:2249
#20 0x00007fdfca266fc2 in main (argc=42, argv=0x7ffff517d638,
envp=0x7ffff517d790) at vl.c:4814

We find the nbd_recv_coroutines_enter_all function will enter a coroutine which
is waiting for the sending lock. If the lock is still held by another coroutine,
the entering coroutine will be added into the co_queue again. Latter, when the
lock is released, a coroutine re-enter error will occur. 

Bin Wu (1):
  qemu-coroutine-lock: fix co_queue multi-adding bug

 include/block/coroutine_int.h | 1 +
 qemu-coroutine-lock.c         | 6 +++++-
 qemu-coroutine.c              | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

-- 
1.7.12.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-02-10  6:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-07  9:51 [Qemu-devel] [PATCH] fix the co_queue multi-adding bug w00214312
2015-02-07  9:51 ` [Qemu-devel] [PATCH] qemu-coroutine-lock: fix " w00214312
2015-02-09  8:12   ` Fam Zheng
2015-02-09  9:36     ` Bin Wu
2015-02-09  9:37       ` Paolo Bonzini
2015-02-09 10:12       ` Kevin Wolf
2015-02-10  1:08         ` Bin Wu
2015-02-09  9:23 ` [Qemu-devel] [PATCH] fix the " Paolo Bonzini
2015-02-09  9:47   ` Bin Wu
2015-02-10  6:34   ` Bin Wu

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).