From nobody Sun Nov 9 14:50:03 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 1550843403909807.4806550061611; Fri, 22 Feb 2019 05:50:03 -0800 (PST) Received: from localhost ([127.0.0.1]:50956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxBDE-0008O3-UQ for importer@patchew.org; Fri, 22 Feb 2019 08:50:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxBBW-0007KL-Ho for qemu-devel@nongnu.org; Fri, 22 Feb 2019 08:48:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxBBV-0001j0-8G for qemu-devel@nongnu.org; Fri, 22 Feb 2019 08:48:14 -0500 Received: from fanzine.igalia.com ([91.117.99.155]:56217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gxBBU-0000id-9j for qemu-devel@nongnu.org; Fri, 22 Feb 2019 08:48:13 -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 1gxBAX-0007yp-3z; Fri, 22 Feb 2019 14:47:13 +0100 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1gxBAJ-0006PP-Ax; Fri, 22 Feb 2019 15:46:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=0iPo2k3bH8pn4gRDYERDF4nATCAe/9vuWKzjs5OdYks=; b=Hi1LDl37AnDkgUS4ijRzEpxlKngpkVfZsDXks4WqGx2msbCY/CiDmUAVoVQlb2pQclMh7CmHVwWZ5wzcEaqoHmlxr7ywfrYKaZQqC8Eq9FGDSyYOow6TZwl3fjZ4l+jyPrDfuuxd+6HxEvZWFU3sladEoTHK5REAr95WFKnkOFwvVYRIhMUnOC5d8y31+M8cIa90PjavsdX4rKLMKFfEX8A95uqSW/ghqgE5uAoR0QD/JgFz1kjpkk5KjxWWkVQ59M+CPhfDbWj0LemEOhCmgFvs46WFa8UxakS73xrTKoz7LmatKd7Z9Lh5S2S+xrzURyMpksuJDTEqc4t5/BFk5w==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 22 Feb 2019 15:46:24 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 v3 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) 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