From nobody Sun Nov 9 14:50:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550836914277508.1809428992931; Fri, 22 Feb 2019 04:01:54 -0800 (PST) Received: from localhost ([127.0.0.1]:49225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gx9WU-0005g8-Nk for importer@patchew.org; Fri, 22 Feb 2019 07:01:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gx9Un-0004uS-Qo for qemu-devel@nongnu.org; Fri, 22 Feb 2019 07:00:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gx9Um-000472-Qm for qemu-devel@nongnu.org; Fri, 22 Feb 2019 07:00:01 -0500 Received: from fanzine.igalia.com ([91.117.99.155]:39613) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gx9Um-0003ph-74 for qemu-devel@nongnu.org; Fri, 22 Feb 2019 07:00:00 -0500 Received: from 62-165-147-230.co.dnainternet.fi ([62.165.147.230] helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1gx9UZ-0005RL-JY; Fri, 22 Feb 2019 12:59:47 +0100 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1gx9UL-0002kN-QB; Fri, 22 Feb 2019 13:59:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=o6fOduiHi6Wo+QbByeVCTahnlzURTUwEv4ZdqgfqpX8=; b=bqRGYr1txrnf1u0gMqdjwL9tWpQF9tGHwnRprh9sGoWRn88Q4Mffa+wwbFqXirY4vi6C6jd8F7vylm7bR3kzni9Sz8TPakn4n6yNRCIegn2ZnxW69/EiaShb7LHl4fWHyxa+Br7jDyTSl95I+b5i3SaWG10kHQgAYdfrklxIbiwi6ZnQC5CZaR8gkMAfXwRRdxE+77oqNasdD8vUVICG136iFInGCg1aOYRiwAqxauAxghK6wZ0H6Pyt8MFiJUcEIBoWTJUgOegXZ2xXiPXEI+n/kFDHRaViHq3KT6n8BHSVAP557c0BRGF0iSTlzdg8ijwEYPvr1Kndl+Oe+OGksg==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 22 Feb 2019 13:59:10 +0200 Message-Id: <0df0773f716140fec012d6778220b8a07067a5c6.1550836631.git.berto@igalia.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH v2 1/3] main-loop: Fix GSource leak in qio_task_thread_worker() 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: Paolo Bonzini , Alberto Garcia , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" After g_source_attach() the GMainContext holds a reference to the GSource, so the caller does not need to keep it. qio_task_thread_worker() is not releasing its reference so the GSource is being leaked since a17536c594bfed94d05667b419f747b692f5fc7f. Signed-off-by: Alberto Garcia Reviewed-by: Daniel P. Berrang=C3=A9 --- io/task.c | 1 + 1 file changed, 1 insertion(+) diff --git a/io/task.c b/io/task.c index 64c4c7126a..1ae7b86488 100644 --- a/io/task.c +++ b/io/task.c @@ -136,6 +136,7 @@ static gpointer qio_task_thread_worker(gpointer opaque) qio_task_thread_result, task, NULL); g_source_attach(task->thread->completion, task->thread->context); + g_source_unref(task->thread->completion); trace_qio_task_thread_source_attach(task, task->thread->completion); =20 qemu_cond_signal(&task->thread_cond); --=20 2.11.0