From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b50E3-0002Ok-Q3 for qemu-devel@nongnu.org; Mon, 23 May 2016 20:29:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b50Dz-0003MT-Ii for qemu-devel@nongnu.org; Mon, 23 May 2016 20:29:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b50Dz-0003LU-Co for qemu-devel@nongnu.org; Mon, 23 May 2016 20:29:31 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C68C84946E for ; Tue, 24 May 2016 00:29:26 +0000 (UTC) Date: Tue, 24 May 2016 08:29:26 +0800 From: Fam Zheng Message-ID: <20160524002926.GA14601@ad.usersys.redhat.com> References: <1463767231-13379-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1463767231-13379-1-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH] tests: avoid coroutine pool test crash List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org 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 > Signed-off-by: Stefan Hajnoczi > --- > 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