From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XN138-0003zz-9O for qemu-devel@nongnu.org; Thu, 28 Aug 2014 10:51:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XN12z-0006i6-FP for qemu-devel@nongnu.org; Thu, 28 Aug 2014 10:51:42 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:58001 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XN12z-0006hi-99 for qemu-devel@nongnu.org; Thu, 28 Aug 2014 10:51:33 -0400 Date: Thu, 28 Aug 2014 16:50:43 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140828145043.GC28789@irqsave.net> References: <1409221675-21916-1-git-send-email-namei.unix@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1409221675-21916-1-git-send-email-namei.unix@gmail.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] 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 , Markus Armbruster The Thursday 28 Aug 2014 =E0 18:27:55 (+0800), Liu Yuan wrote : > We should reinit local_err as NULL inside the while loop or g_free() wi= ll report > corrupption and abort the QEMU when sheepdog driver tries reconnecting. >=20 > This was broken in commit 356b4ca. >=20 > qemu-system-x86_64: failed to get the header, Resource temporarily unav= ailable > 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: Assertio= n `!xcb_xlib_threads_sequence_lost' failed. > Aborted (core dumped) >=20 > Cc: qemu-devel@nongnu.org > Cc: Markus Armbruster > Cc: Kevin Wolf > Cc: Stefan Hajnoczi > Reviewed-by: Markus Armbruster > Signed-off-by: Liu Yuan > --- > block/sheepdog.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/block/sheepdog.c b/block/sheepdog.c > index 12cbd9d..53c24d6 100644 > --- a/block/sheepdog.c > +++ b/block/sheepdog.c > @@ -712,7 +712,6 @@ static void coroutine_fn send_pending_req(BDRVSheep= dogState *s, uint64_t oid) > =20 > static coroutine_fn void reconnect_to_sdog(void *opaque) > { > - Error *local_err =3D NULL; > BDRVSheepdogState *s =3D opaque; > AIOReq *aio_req, *next; > =20 > @@ -727,6 +726,7 @@ static coroutine_fn void reconnect_to_sdog(void *op= aque) > =20 > /* Try to reconnect the sheepdog server every one second. */ > while (s->fd < 0) { > + Error *local_err =3D NULL; > s->fd =3D get_sheep_fd(s, &local_err); > if (s->fd < 0) { > DPRINTF("Wait for connection to be established\n"); > --=20 > 1.9.1 >=20 >=20 I am not a sheepdog expert but from the code it looks good. Reviewed-by: Beno=EEt Canet