From patchwork Thu Sep 7 05:36:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vivien Kraus X-Patchwork-Id: 16693 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 75BE727BBEA; Thu, 7 Sep 2023 21:31:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AD15D27BBE2 for ; Thu, 7 Sep 2023 21:31:21 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeLea-0007gM-JW; Thu, 07 Sep 2023 16:31:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeLeW-0007du-Ks for guix-patches@gnu.org; Thu, 07 Sep 2023 16:31:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeLeW-0006yw-C5 for guix-patches@gnu.org; Thu, 07 Sep 2023 16:31:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qeLeY-0006if-5B for guix-patches@gnu.org; Thu, 07 Sep 2023 16:31:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65798] [PATCH gnome-team v2] Cogl: fix double free References: <03afaf481dfe74a9de14c77febf5d9241d0010e7.camel@planete-kraus.eu> In-Reply-To: <03afaf481dfe74a9de14c77febf5d9241d0010e7.camel@planete-kraus.eu> Resent-From: Vivien Kraus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 07 Sep 2023 20:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65798 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65798@debbugs.gnu.org Cc: rg@raghavgururajan.name, liliana.prikler@gmail.com, maxim.cournoyer@gmail.com Received: via spool by 65798-submit@debbugs.gnu.org id=B65798.169411863025789 (code B ref 65798); Thu, 07 Sep 2023 20:31:02 +0000 Received: (at 65798) by debbugs.gnu.org; 7 Sep 2023 20:30:30 +0000 Received: from localhost ([127.0.0.1]:41478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeLe2-0006ht-2e for submit@debbugs.gnu.org; Thu, 07 Sep 2023 16:30:30 -0400 Received: from planete-kraus.eu ([89.234.140.182]:45220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeLdz-0006hj-AN for 65798@debbugs.gnu.org; Thu, 07 Sep 2023 16:30:28 -0400 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 18ce9c06; Thu, 7 Sep 2023 20:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:from:date:subject:mime-version:content-type :content-transfer-encoding:to:cc; s=albinoniA; bh=xtHwQxAEhFInu5 jvBG+8tGYc2+o=; b=H0oXZnLhnwWJxRpCuK6bMt9/Q9wpQRlpg8Q2YnB+bEdmDB qlKdYA3KNPj3/gjQpL8PziwM1QVR4OHw/LRzklq9o3lN0W8+ckJLx5z1FXfdWhxW swyG4Kk9fjMXipiHa1MA1vENVWV71jrNn9s/6LuJ4soGBUD2S/O99wkmBIb2bbzI LtwN3dsNl7aFGrTE9bQx4uA+4c0XHDgiXrfr5rATT8T3Y85fjQ63Pcyh1wLijZFB iQ1UXZW/IuE/klueJ4gf+6ZStPyYrZXt30o1KTEGFt/pktIqckwS++YcGk/k39UO s+JkGTHIUV5KPYFDmE+7Zhsce0Llj7ErdMYtiakw== Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id 5339c475 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Thu, 7 Sep 2023 20:30:23 +0000 (UTC) Message-ID: <018c75fd44fa1b1462a49f5bf700b9194d9c6341.1694118524.git.vivien@planete-kraus.eu> Date: Thu, 7 Sep 2023 07:36:31 +0200 MIME-Version: 1.0 User-Agent: Evolution 3.46.4 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Vivien Kraus X-ACL-Warn: , Vivien Kraus via Guix-patches X-Patchwork-Original-From: Vivien Kraus via Guix-patches via From: Vivien Kraus Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/local.mk (dist_patch_DATA): Add cogl-fix-double-free.patch. * gnu/packages/gnome.scm (cogl): Apply cogl-fix-double-free.patch. * gnu/packages/patches/cogl-fix-double-free.patch: Avoid freeing the dispaly used by a cogl context twice. Since the cogl repository is read-only, this patch won’t be applied upstream. --- gnu/local.mk | 1 + gnu/packages/gnome.scm | 4 ++- .../patches/cogl-fix-double-free.patch | 31 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/cogl-fix-double-free.patch base-commit: baf5b0745446dabe8166d860996dc54cfa09db3e diff --git a/gnu/local.mk b/gnu/local.mk index 24fa8117c6..ae36dd49c9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1024,6 +1024,7 @@ dist_patch_DATA = \ %D%/packages/patches/clucene-pkgconfig.patch \ %D%/packages/patches/cmake-curl-certificates-3.24.patch \ %D%/packages/patches/coda-use-system-libs.patch \ + %D%/packages/patches/cogl-fix-double-free.patch \ %D%/packages/patches/collectd-5.11.0-noinstallvar.patch \ %D%/packages/patches/combinatorial-blas-awpm.patch \ %D%/packages/patches/combinatorial-blas-io-fix.patch \ diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 922d6ba24b..6b824c2832 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -6131,7 +6131,9 @@ (define-public cogl (version-major+minor version) "/" "cogl-" version ".tar.xz")) (sha256 - (base32 "0nfph4ai60ncdx7hy6hl1i1cmp761jgnyjfhagzi0iqq36qb41d8")))) + (base32 "0nfph4ai60ncdx7hy6hl1i1cmp761jgnyjfhagzi0iqq36qb41d8")) + (patches + (search-patches "cogl-fix-double-free.patch")))) ;; NOTE: mutter exports a bundled fork of cogl, so when making changes to ;; cogl, corresponding changes may be appropriate in mutter as well. (build-system gnu-build-system) diff --git a/gnu/packages/patches/cogl-fix-double-free.patch b/gnu/packages/patches/cogl-fix-double-free.patch new file mode 100644 index 0000000000..7094c4cf02 --- /dev/null +++ b/gnu/packages/patches/cogl-fix-double-free.patch @@ -0,0 +1,31 @@ +From 38d3fda8849ac327b473ac11dfac5499f595b7ac Mon Sep 17 00:00:00 2001 +Message-ID: <38d3fda8849ac327b473ac11dfac5499f595b7ac.1694118000.git.vivien@planete-kraus.eu> +In-Reply-To: +References: +From: Vivien Kraus +Date: Thu, 7 Sep 2023 22:16:48 +0200 +Subject: [PATCH 1/1] Prevent double free on context objects + +The display is unrefed in the context destructor, but not refed in the +constructor. + +This targets an archived (read-only) repository. +--- + cogl/cogl-context.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/cogl/cogl-context.c b/cogl/cogl-context.c +index a7eed29a..22809424 100644 +--- a/cogl/cogl-context.c ++++ b/cogl/cogl-context.c +@@ -219,6 +219,7 @@ cogl_context_new (CoglDisplay *display, + } + + context->display = display; ++ cogl_object_ref (display); + + /* This is duplicated data, but it's much more convenient to have + the driver attached to the context and the value is accessed a +-- +2.41.0 +