From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAHxn-0002xd-7D for qemu-devel@nongnu.org; Tue, 07 Jun 2016 10:26:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAHxh-0006Yz-5U for qemu-devel@nongnu.org; Tue, 07 Jun 2016 10:26:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAHxg-0006Yi-VF for qemu-devel@nongnu.org; Tue, 07 Jun 2016 10:26:33 -0400 From: Stefan Hajnoczi Date: Tue, 7 Jun 2016 15:26:14 +0100 Message-Id: <1465309585-31551-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1465309585-31551-1-git-send-email-stefanha@redhat.com> References: <1465309585-31551-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 01/12] tests: avoid coroutine pool test crash List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Stefan Hajnoczi 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 Reviewed-by: Fam Zheng Message-id: 1463767231-13379-1-git-send-email-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