From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCX2d-0003e7-2q for qemu-devel@nongnu.org; Mon, 13 Jun 2016 14:56:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCX2a-0004RD-VI for qemu-devel@nongnu.org; Mon, 13 Jun 2016 14:56:54 -0400 References: <1464694565-16784-1-git-send-email-clg@kaod.org> <574D9F0F.7060904@redhat.com> <574D9FBB.60100@kaod.org> <574DA17D.5070505@redhat.com> <575EDE86.6080201@kaod.org> <575EE3B7.5080209@redhat.com> <575EF0AC.20305@kaod.org> From: Eric Blake Message-ID: <575F01EE.2050208@redhat.com> Date: Mon, 13 Jun 2016 12:56:46 -0600 MIME-Version: 1.0 In-Reply-To: <575EF0AC.20305@kaod.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dqNCWeen0RghdoeVLGR2rhdaJAxrM1xAf" Subject: Re: [Qemu-devel] [PATCH] m25p80: fix test on blk_pread() return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Cc: Peter Crosthwaite , Kevin Wolf , Max Reitz , qemu-block@nongnu.org, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dqNCWeen0RghdoeVLGR2rhdaJAxrM1xAf Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/13/2016 11:43 AM, C=C3=A9dric Le Goater wrote: > On 06/13/2016 06:47 PM, Eric Blake wrote: >> On 06/13/2016 10:25 AM, C=C3=A9dric Le Goater wrote: >> >>> >>> It seems that commit 243e6f69c129 ("m25p80: Switch to byte-based bloc= k access")=20 >>> is bringing another issue : >>> >>> qemu-system-arm: /home/legoater/work/qemu/qemu-ast2400-mainline.git/b= lock/io.c:1252: bdrv_aligned_pwritev: Assertion `!qiov || bytes =3D=3D qi= ov->size' failed. >>> Aborted (core dumped) >> >> Can you provide a more complete stack dump,=20 >=20 > yes, see below.=20 >=20 >> and/or a recipe on how to repeat the assertion? >=20 > That's more difficult right now. The patchset I am working on is not=20 > mainline. It adds the SPI controller to the ast2400 soc and it uses=20 > m25p80 flash modules with -mtdblock.=20 >=20 > I am trying to rebase on qemu's head to send it and I am hitting this=20 > issue. So I need to find a simpler way to reproduce, with code only in > mainline of course. >=20 > Until then, here is a gdb backtrace. Sorry about that. >=20 > #4 0x00007fa81c6694ac in bdrv_aligned_pwritev (bs=3D0x7fa81d4dd050, re= q=3D, offset=3D30878208,=20 > bytes=3D512, qiov=3D0x7fa7f47fee60, flags=3D0) > at /home/legoater/work/qemu/qemu-ast2400-mainline.git/block/io.c:12= 43 > #5 0x00007fa81c669ecb in bdrv_co_pwritev (bs=3D0x7fa81d4dd050, offset=3D= 8, bytes=3D512, qiov=3D0x7fa80d5191c0,=20 > flags=3D(BDRV_REQ_COPY_ON_READ | BDRV_REQ_ZERO_WRITE | BDRV_REQ_MAY= _UNMAP | BDRV_REQ_NO_SERIALISING | BDRV_REQ_FUA | unknown: 4278124256), f= lags@entry=3D(unknown: 0)) > at /home/legoater/work/qemu/qemu-ast2400-mainline.git/block/io.c:14= 92 That 'flags' value looks bogus... > #6 0x00007fa81c65e367 in blk_co_pwritev (blk=3D0x7fa81d4c5b60, offset=3D= 30878208, bytes=3D256, qiov=3D0x7fa80d5191c0,=20 > flags=3D(unknown: 0)) at /home/legoater/work/qemu/qemu-ast2400-main= line.git/block/block-backend.c:788 > #7 0x00007fa81c65e49b in blk_aio_write_entry (opaque=3D0x7fa7e849aca0)= > at /home/legoater/work/qemu/qemu-ast2400-mainline.git/block/block-b= ackend.c:977 > #8 0x00007fa81c6c823a in coroutine_trampoline (i0=3D, i= 1=3D) > at /home/legoater/work/qemu/qemu-ast2400-mainline.git/util/coroutin= e-ucontext.c:78 > #9 0x00007fa818ea8f00 in ?? () from /lib/x86_64-linux-gnu/libc.so.6 and we don't get anything further in the backtrace beyond coroutines, to see who's sending the bad parameters. I recently debugged a bogus flags in bdrv_aio_preadv, by hoisting an assert to occur before coroutines are used in blk_aio_prwv(): https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg02948.html I've just posted v2 of that patch (now a 2/2 series), but in v2 no longer kept the assert at that point. But maybe the correct fix, and/or the hack for catching the bug prior to coroutines, will help you debug where the bad arguments are coming from. > #10 0x00007fa80d5189d0 in ?? () > #11 0x0000000000000000 in ?? () > (gdb) up 4 > #4 0x00007fa81c6694ac in bdrv_aligned_pwritev (bs=3D0x7fa81d4dd050, re= q=3D, offset=3D30878208,=20 > bytes=3D512, qiov=3D0x7fa7f47fee60, flags=3D0) > at /home/legoater/work/qemu/qemu-ast2400-mainline.git/block/io.c:12= 43 > 1243 assert(!qiov || bytes =3D=3D qiov->size); > (gdb) p *qiov=20 > $1 =3D {iov =3D 0x7fa81da671d0, niov =3D 1, nalloc =3D 1, size =3D 256}= >=20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --dqNCWeen0RghdoeVLGR2rhdaJAxrM1xAf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXXwHuAAoJEKeha0olJ0NqA3wH/3VEFoUi7mP6yq0IVcxLEfCM Hb/xWuS0xOHYHnfXkGk/c7cLVF7yM3rnb9fMRH8EGHWCP1Mr8mn2qloStQecmOPA vdIvrBsEjWEuqyhIJTRKmhI6pUOF/tDZtjYuo3iyOhRXWQHy7UXtHfT6zludc/pX LWG3D9mmV98z7oIs+qOhDo1sOn4JD7ZpPSdU11CbmvlNPdzr/JQZY9mzHVv6gEcq VEFct3p3yGacRD9UDPjGopDGHpT33wBQy2T/cb0A5161iRN+bI7yca0L9ho69t0y WdaBroSYGgBpFMGUyW0Wd6A0fe9ktf4C56dgkcPb19pIDS9Y8GUPrIsDfHsWewo= =cFaV -----END PGP SIGNATURE----- --dqNCWeen0RghdoeVLGR2rhdaJAxrM1xAf--