qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] tests: avoid coroutine pool test crash
Date: Tue, 24 May 2016 08:29:26 +0800	[thread overview]
Message-ID: <20160524002926.GA14601@ad.usersys.redhat.com> (raw)
In-Reply-To: <1463767231-13379-1-git-send-email-stefanha@redhat.com>

On Fri, 05/20 11:00, Stefan Hajnoczi wrote:
> Skip the test_co_queue test case if the coroutine pool is not enabled.
> The test case does not work without the pool because it touches memory
> belonging to a freed coroutine (on purpose).
> 
> Reported-by: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  tests/test-coroutine.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c
> index dd4ced9..ea7f87f 100644
> --- a/tests/test-coroutine.c
> +++ b/tests/test-coroutine.c
> @@ -369,7 +369,15 @@ static void perf_cost(void)
>  int main(int argc, char **argv)
>  {
>      g_test_init(&argc, &argv, NULL);
> -    g_test_add_func("/basic/co_queue", test_co_queue);
> +
> +    /* This test assumes there is a freelist and marks freed coroutine memory
> +     * with a sentinel value.  If there is no freelist this would legitimately
> +     * crash, so skip it.
> +     */
> +    if (CONFIG_COROUTINE_POOL) {
> +        g_test_add_func("/basic/co_queue", test_co_queue);
> +    }
> +
>      g_test_add_func("/basic/lifecycle", test_lifecycle);
>      g_test_add_func("/basic/yield", test_yield);
>      g_test_add_func("/basic/nesting", test_nesting);
> -- 
> 2.5.5
> 
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

  reply	other threads:[~2016-05-24  0:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20 18:00 [Qemu-devel] [PATCH] tests: avoid coroutine pool test crash Stefan Hajnoczi
2016-05-24  0:29 ` Fam Zheng [this message]
2016-05-27 21:32 ` Stefan Hajnoczi

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=20160524002926.GA14601@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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 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).