All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Qemu-block <qemu-block@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	pl@kamp.de, jsnow@redhat.com
Subject: Re: [Qemu-devel] [PULL 00/18] Block layer patches
Date: Thu, 29 Sep 2016 12:25:07 +0200	[thread overview]
Message-ID: <20160929102507.GD5742@noname.redhat.com> (raw)
In-Reply-To: <CAFEAcA__cOs3ey3Dgzc1zcY=diF3EDyOwmbyLemWynksvajatw@mail.gmail.com>

Am 28.09.2016 um 21:03 hat Peter Maydell geschrieben:
> On 28 September 2016 at 02:37, Kevin Wolf <kwolf@redhat.com> wrote:
> > Am 27.09.2016 um 21:42 hat Peter Maydell geschrieben:
> >> On 27 September 2016 at 06:53, Kevin Wolf <kwolf@redhat.com> wrote:
> >> > The following changes since commit 7cfdc02dae0d2ff58c897496cfdbbafc0eda0f3f:
> >> >
> >> >   Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2016-09-26 19:47:00 +0100)
> >> >
> >> > are available in the git repository at:
> >> >
> >> >
> >> >   git://repo.or.cz/qemu/kevin.git tags/for-upstream
> >> >
> >> > for you to fetch changes up to 3b856cebe5e93547852c156ca2119d075e62aed7:
> >> >
> >> >   coroutine: reduce stack size to 60kB (2016-09-27 14:05:21 +0200)
> >> >
> >> > ----------------------------------------------------------------
> >> > Block layer patches
> >> >
> >> > ----------------------------------------------------------------
> >>
> >> I see 'make check' failures on x86-64 host, clang Linux:
> >>
> >>   /i386/ahci/migrate/ncq/simple:                                       OK
> >>   /i386/ahci/migrate/ncq/halted:                                       OK
> >>   /i386/ahci/cdrom/dma/single:                                         OK
> >>   /i386/ahci/cdrom/dma/multi:                                          OK
> >>   /i386/ahci/cdrom/pio/single:
> >> Broken pipe
> >> FAIL
> >> GTester: last random seed: R02Sa8f729848b07c3b3e5ee67368f9d0350
> >> (pid=10590)
> >>   /i386/ahci/cdrom/pio/multi:
> >> Broken pipe
> >> FAIL
> >> GTester: last random seed: R02Se85704e04bbd382223983c878723b811
> >> (pid=10598)
> >> FAIL: tests/ahci-test
> >> TEST: tests/hd-geo-test... (pid=10601)
> >>   /i386/hd-geo/ide/none:                                               OK
> >
> > I asked on IRC, but as you don't seem to be around at the moment, I'll
> > keep things on the list instead.
> 
> I got a gdb backtrace:
> 
> Thread 1 "qemu-system-i38" received signal SIGSEGV, Segmentation fault.
> 0x00005555561dea15 in address_space_translate (as=0x55555a46bfc0,
> addr=1106048, xlat=0x7ffff7e0d050, plen=0x7ffff7e0d058,
>     is_write=false) at /home/petmay01/linaro/qemu-for-merges/exec.c:423
> 423     {
> 
> 
> Backtrace suggests we've run out of stack due to some infinite
> recursion:

Thanks, Peter, this is useful.

The series contains a patch that reduces the coroutine stack size, so I
guess it's not quite infinite, but pretty deep recursion anyway. I will
drop that final patch that reduces the stack size and hope that the rest
will pass your testing (I tried some more to reproduce it, but I still
didn't manage to).

John, can you have a look at the IDE code and check whether we can get
rid of the deep recursion? It seems that the test issues a large request
that is then split into many small requests. But it should be possible
to do this iteratively rather than recursively.

Kevin

> #0  0x00005555561dea15 in address_space_translate (as=0x55555a46bfc0,
> addr=1106048, xlat=0x7ffff7e0d050, plen=0x7ffff7e0d058,
> is_write=false) at /home/petmay01/linaro/qemu-for-merges/exec.c:423
> #1  0x00005555561edeab in address_space_map (as=<optimised out>,
> addr=1106048, plen=<optimised out>, is_write=false)
>     at /home/petmay01/linaro/qemu-for-merges/exec.c:2909
> #2  0x0000555556840b9b in ahci_populate_sglist (as=0x55555a46bfc0,
> addr=1106048, dir=DMA_DIRECTION_TO_DEVICE, len=<optimised out>)
>     at /home/petmay01/linaro/qemu-for-merges/include/sysemu/dma.h:135
> #3  0x0000555556840b9b in ahci_populate_sglist (ad=<optimised out>,
> sglist=<optimised out>, cmd=<optimised out>, limit=<optimised out>,
> offset=1592) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:863
> #4  0x0000555556844de4 in ahci_dma_prepare_buf (dma=0x55555a475b48,
> limit=<optimised out>)
>     at /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1366
> #5  0x000055555684354c in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1295
> #6  0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #7  0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #8  0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #9  0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #10 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #11 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #12 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #13 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #14 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #15 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #16 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #17 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #18 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #19 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #20 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #21 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #22 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #23 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #24 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #25 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #26 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #27 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #28 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #29 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #30 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #31 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #32 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #33 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #34 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #35 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #36 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #37 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #38 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #39 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #40 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #41 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>) at
> /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> 
> [skip a lot of repeated stack frames]
> 
> #393 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #394 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #395 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #396 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #397 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #398 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #399 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #400 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #401 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #402 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #403 0x0000555556843662 in ahci_start_transfer (dma=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/ahci.c:1318
> #404 0x00005555568250cb in ide_atapi_cmd_reply_end (s=<optimised out>)
> at /home/petmay01/linaro/qemu-for-merges/hw/ide/atapi.c:324
> #405 0x0000555556809cfc in ide_buffered_readv_cb
> (opaque=0x5555594f57e0, ret=<optimised out>)
>     at /home/petmay01/linaro/qemu-for-merges/hw/ide/core.c:605
> #406 0x0000555556df7f73 in blk_aio_complete (acb=0x55555a4387c0) at
> /home/petmay01/linaro/qemu-for-merges/block/block-backend.c:943
> #407 0x0000555556f676f1 in coroutine_trampoline (i0=<optimised out>,
> i1=<optimised out>)
>     at /home/petmay01/linaro/qemu-for-merges/util/coroutine-ucontext.c:79
> #408 0x00007fffdca05590 in __start_context () at /lib/x86_64-linux-gnu/libc.so.6
> #409 0x00007fffffffc318 in  ()
> #410 0x0000000000000000 in  ()
> 
> 
> thanks
> -- PMM

  reply	other threads:[~2016-09-29 10:25 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-27 13:53 [Qemu-devel] [PULL 00/18] Block layer patches Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 01/18] block: reintroduce bdrv_flush_all Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 02/18] qemu: use bdrv_flush_all for vm_stop et al Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 03/18] block-backend: remove blk_flush_all Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 04/18] block: Fix error path in qmp_blockdev_change_medium() Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 05/18] block: Drop aio/cache consistency check from qmp_blockdev_add() Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 06/18] block/qapi: Use separate options type for curl driver Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 07/18] block/qapi: Move 'aio' option to file driver Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 08/18] block: Parse 'detect-zeroes' in bdrv_open_common() Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 09/18] block: Use 'detect-zeroes' option for 'blockdev-change-medium' Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 10/18] block: Move 'discard' option to bdrv_open_common() Kevin Wolf
2016-10-07  9:01   ` Gerd Hoffmann
2016-10-07 10:20     ` Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 11/18] block: Remove qemu_root_bds_opts Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 12/18] oslib-posix: add helpers for stack alloc and free Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 13/18] coroutine-sigaltstack: rename coroutine struct appropriately Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 14/18] coroutine: add a macro for the coroutine stack size Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 15/18] coroutine-ucontext: use helper for allocating stack memory Kevin Wolf
2016-09-27 13:53 ` [Qemu-devel] [PULL 16/18] coroutine-sigaltstack: " Kevin Wolf
2016-09-27 13:54 ` [Qemu-devel] [PULL 17/18] oslib-posix: add a configure switch to debug stack usage Kevin Wolf
2016-09-27 13:54 ` [Qemu-devel] [PULL 18/18] coroutine: reduce stack size to 60kB Kevin Wolf
2016-09-27 19:42 ` [Qemu-devel] [PULL 00/18] Block layer patches Peter Maydell
2016-09-28  9:37   ` Kevin Wolf
2016-09-28 14:52     ` Peter Maydell
2016-09-28 19:03     ` Peter Maydell
2016-09-29 10:25       ` Kevin Wolf [this message]
2016-09-29 17:02         ` John Snow
2016-09-29 18:17           ` Paolo Bonzini
2016-09-29 18:19             ` John Snow
2016-09-29 17:18         ` Peter Maydell
2016-09-29 18:19           ` John Snow
  -- strict thread matches above, loose matches on Subject: below --
2016-09-14 16:40 Max Reitz
2016-09-14 20:16 ` no-reply
2016-09-15 16:10 ` Peter Maydell
2016-09-17 21:32   ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160929102507.GD5742@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.