Received: from eggs.gnu.org ([2001:4830:134:3::10]:39749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMwVG-0002bg-3f for qemu-devel@nongnu.org; Thu, 28 Aug 2014 06:00:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMwVB-0006im-0w for qemu-devel@nongnu.org; Thu, 28 Aug 2014 06:00:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMwVA-0006hn-QB for qemu-devel@nongnu.org; Thu, 28 Aug 2014 06:00:20 -0400 From: Markus Armbruster References: <1409212630-8185-1-git-send-email-namei.unix@gmail.com> Date: Thu, 28 Aug 2014 12:00:09 +0200 In-Reply-To: <1409212630-8185-1-git-send-email-namei.unix@gmail.com> (Liu Yuan's message of "Thu, 28 Aug 2014 15:57:10 +0800") Message-ID: <87zjep0w9i.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] sheepdog: fix a core dump while do auto-reconnecting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Yuan Cc: Kevin Wolf , sheepdog@lists.wpkg.org, qemu-devel@nongnu.org, Stefan Hajnoczi Liu Yuan writes: > We should reinit Local_err as NULL inside the while loop or g_free() will report You misspelled local_err. > corrupption and abort the QEMU when sheepdog driver tries reconnecting. > > qemu-system-x86_64: failed to get the header, Resource temporarily unavailable > qemu-system-x86_64: Failed to connect to socket: Connection refused > qemu-system-x86_64: (null) > [xcb] Unknown sequence number while awaiting reply > [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called > [xcb] Aborting, sorry about that. > qemu-system-x86_64: ../../src/xcb_io.c:298: poll_for_response: Assertion `!xcb_xlib_threads_sequence_lost' failed. > Aborted (core dumped) Broken in commit 356b4ca. Suggest to add that to the commit message. > Cc: qemu-devel@nongnu.org > Cc: Markus Armbruster > Cc: Kevin Wolf > Cc: Stefan Hajnoczi > Signed-off-by: Liu Yuan > --- > block/sheepdog.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/sheepdog.c b/block/sheepdog.c > index 3af8743..a3a19b1 100644 > --- a/block/sheepdog.c > +++ b/block/sheepdog.c > @@ -712,7 +712,6 @@ static void coroutine_fn send_pending_req(BDRVSheepdogState *s, uint64_t oid) > > static coroutine_fn void reconnect_to_sdog(void *opaque) > { > - Error *local_err = NULL; > BDRVSheepdogState *s = opaque; > AIOReq *aio_req, *next; > BlockDriverState *bs = s->bs; > @@ -731,6 +730,7 @@ static coroutine_fn void reconnect_to_sdog(void *opaque) > > /* Try to reconnect the sheepdog server every one second. */ > while (s->fd < 0) { > + Error *local_err = NULL; > s->fd = get_sheep_fd(s, &local_err); > if (s->fd < 0) { > DPRINTF("Wait for connection to be established\n"); Thanks for fixing the mess I made. Reviewed-by: Markus Armbruster