unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Vivien Kraus via Guix-patches via <guix-patches@gnu.org>
To: 65798@debbugs.gnu.org
Cc: rg@raghavgururajan.name, liliana.prikler@gmail.com,
	maxim.cournoyer@gmail.com
Subject: [bug#65798] [PATCH gnome-team v2] Cogl: fix double free
Date: Thu, 7 Sep 2023 07:36:31 +0200	[thread overview]
Message-ID: <018c75fd44fa1b1462a49f5bf700b9194d9c6341.1694118524.git.vivien@planete-kraus.eu> (raw)
In-Reply-To: <03afaf481dfe74a9de14c77febf5d9241d0010e7.camel@planete-kraus.eu>

* 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

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: <cover.1694118000.git.vivien@planete-kraus.eu>
+References: <cover.1694118000.git.vivien@planete-kraus.eu>
+From: Vivien Kraus <vivien@planete-kraus.eu>
+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
+

base-commit: baf5b0745446dabe8166d860996dc54cfa09db3e
-- 
2.41.0




  reply	other threads:[~2023-09-07 20:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07  5:36 [bug#65798] [PATCH gnome-team] Cogl: fix double free Vivien Kraus via Guix-patches via
2023-09-07  5:36 ` Vivien Kraus via Guix-patches via [this message]
2023-09-08  4:24   ` [bug#65798] [PATCH gnome-team v2] " Liliana Marie Prikler
2023-09-07  5:36     ` [bug#65798] [gnome-team v3] " Vivien Kraus via Guix-patches via
2023-09-08 16:59       ` Liliana Marie Prikler
2023-09-15 16:17         ` bug#65798: " Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=018c75fd44fa1b1462a49f5bf700b9194d9c6341.1694118524.git.vivien@planete-kraus.eu \
    --to=guix-patches@gnu.org \
    --cc=65798@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    --cc=maxim.cournoyer@gmail.com \
    --cc=rg@raghavgururajan.name \
    --cc=vivien@planete-kraus.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).