From patchwork Fri Jan 12 11:30:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 859800 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uAbMdrb7"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zJ1Ds1Tjlz9s75 for ; Fri, 12 Jan 2018 22:46:53 +1100 (AEDT) Received: from localhost ([::1]:35276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZxnP-0003OJ-7I for incoming@patchwork.ozlabs.org; Fri, 12 Jan 2018 06:46:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZxYr-0007V0-NW for qemu-devel@nongnu.org; Fri, 12 Jan 2018 06:31:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZxYq-0005Nf-RB for qemu-devel@nongnu.org; Fri, 12 Jan 2018 06:31:49 -0500 Received: from mail-wr0-x22e.google.com ([2a00:1450:400c:c0c::22e]:41544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eZxYq-0005Lg-L7 for qemu-devel@nongnu.org; Fri, 12 Jan 2018 06:31:48 -0500 Received: by mail-wr0-x22e.google.com with SMTP id o7so5029389wro.8 for ; Fri, 12 Jan 2018 03:31:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vOMFsB1fKlCZyX/LQoK1dmFDpEjJGdrnUWOa+sk5HGw=; b=uAbMdrb7te3oMC/n5HVa4JkLQ2DcNOF7iBtYRY9nGaYoFWB2nJu3kFjwIDv4NpCODg HlhxbJmtbDm0Znr7ywl9irUXEt5oVc8ksdY/WiKz+Q4hPQmfHsmxbLRjhkPnhmNsDtJ1 qEvq2C1udMJxj+QOnLcG7Zpeoap/lAOZKzTWBqNpx6ZV7d/yifIcty63ciAfFBNWk37w U4MbYlNgfeGsHGUTLffvj8Ws/EszXKJfjy57FCELOCylU0jKo0Xkxt05j4oqVIH8gw9R h3Eyd0gVM/EzGimTvWhWEmwQolxtqzykd052jI0Mvro88IjfuNtYOkxEoHSUbMtu/FQF F1oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vOMFsB1fKlCZyX/LQoK1dmFDpEjJGdrnUWOa+sk5HGw=; b=s8wMRLaxes1doiggVLMxhbHO05PJp3L82CyR99HdtVwoA646xNSwfHL3VsnNhdPkN6 xAax1ffUolfiDnrsGkOqe4SNe0UiZLsTHGRodvVv496n+e7LAqmxTVZ6Wo16P8b0iIHT oFsVPZB53WnlnuPAeXIR1N5RXIhZQL6zsFRFFBKrj+tLKKGsD2AhBK0y1U4Ax/VhiTmm 7cTLEvNG2Sp8xtt+7xUb3eJqOi2b4M2NTSYQ/IbEpf8uJuxyu6R4ALzGkDCmKHT7I+ed FJIpKVDwP//66Wsuw/l0Y5OPv9B0Pbr9ePJHbq1LKikqwB/bCp6BZ9KQg2bzevtF/L1T BRiQ== X-Gm-Message-State: AKwxytcCBen8MJq/pYRkJlsDJvnUq4apcijkNJZDVFYWTT6EZFVkqdV1 HQLKzAMy1Fop2zLhDXBEkMbWuKch X-Google-Smtp-Source: ACJfBotojmbg7Kl7UhfGm/H+g6lWZru+Ej7tspR0pGDg7CVS9F3RlSTdr+q9wZ7PtmYxhaGDBFRT2Q== X-Received: by 10.223.161.198 with SMTP id v6mr967930wrv.65.1515756707255; Fri, 12 Jan 2018 03:31:47 -0800 (PST) Received: from 640k.lan (dynamic-adsl-78-12-229-84.clienti.tiscali.it. [78.12.229.84]) by smtp.gmail.com with ESMTPSA id l8sm2732271wmg.46.2018.01.12.03.31.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jan 2018 03:31:46 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 12:30:48 +0100 Message-Id: <1515756676-3860-25-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1515756676-3860-1-git-send-email-pbonzini@redhat.com> References: <1515756676-3860-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22e Subject: [Qemu-devel] [PULL 24/52] tests: fix coroutine leak in /basic/entered X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau The coroutine is not finished by the time the test ends, resulting in ASAN warning: ==7005==ERROR: LeakSanitizer: detected memory leaks Direct leak of 312 byte(s) in 1 object(s) allocated from: #0 0x7fd35290fa38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38) #1 0x7fd3506c5f75 in g_malloc0 ../glib/gmem.c:124 #2 0x55994af03e47 in qemu_coroutine_new /home/elmarco/src/qemu/util/coroutine-ucontext.c:144 #3 0x55994aefed99 in qemu_coroutine_create /home/elmarco/src/qemu/util/qemu-coroutine.c:76 #4 0x55994ac1eb50 in verify_entered_step_1 /home/elmarco/src/qemu/tests/test-coroutine.c:80 #5 0x55994af03c75 in coroutine_trampoline /home/elmarco/src/qemu/util/coroutine-ucontext.c:119 #6 0x7fd34ec02bef (/lib64/libc.so.6+0x50bef) Do not yield() to let the coroutine terminate. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Hajnoczi Message-Id: <20180104160523.22995-17-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- tests/test-coroutine.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c index abd97c2..76c6461 100644 --- a/tests/test-coroutine.c +++ b/tests/test-coroutine.c @@ -67,7 +67,6 @@ static void coroutine_fn verify_entered_step_2(void *opaque) /* Once more to check it still works after yielding */ g_assert(qemu_coroutine_entered(caller)); g_assert(qemu_coroutine_entered(qemu_coroutine_self())); - qemu_coroutine_yield(); } static void coroutine_fn verify_entered_step_1(void *opaque)