GNU bug report logs - #65798
[PATCH gnome-team] Cogl: fix double free

Previous Next

Package: guix-patches;

Reported by: Vivien Kraus <vivien <at> planete-kraus.eu>

Date: Thu, 7 Sep 2023 08:30:01 UTC

Severity: normal

Tags: patch

Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Vivien Kraus <vivien <at> planete-kraus.eu>, 65798 <at> debbugs.gnu.org
Cc: rg <at> raghavgururajan.name, maxim.cournoyer <at> gmail.com
Subject: [bug#65798] [gnome-team v3] Cogl: fix double free
Date: Fri, 08 Sep 2023 18:59:05 +0200
Am Donnerstag, dem 07.09.2023 um 07:36 +0200 schrieb Vivien Kraus:
> * gnu/packages/patches/cogl-fix-double-free.patch: Avoid freeing the
> dispaly used by a cogl context twice.
To whom commits this (likely me in the future): s/dispaly/display/
> * gnu/local.mk (dist_patch_DATA): Add cogl-fix-double-free.patch.
> * gnu/packages/gnome.scm (cogl): Apply cogl-fix-double-free.patch.
> Remove the
> comment about the changes to be reflected in mutter, as their bundled
> cogl has
> diverged far enough.
I'll also add a blurb before the ChangeLog and shorten this to make the
change clearer.
> ---
>  gnu/local.mk                                  |  1 +
>  gnu/packages/gnome.scm                        |  6 ++--
>  .../patches/cogl-fix-double-free.patch        | 32
> +++++++++++++++++++
>  3 files changed, 36 insertions(+), 3 deletions(-)
>  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..894aac8202 100644
> --- a/gnu/packages/gnome.scm
> +++ b/gnu/packages/gnome.scm
> @@ -6131,9 +6131,9 @@ (define-public cogl
>                             (version-major+minor version) "/"
>                             "cogl-" version ".tar.xz"))
>         (sha256
> -        (base32
> "0nfph4ai60ncdx7hy6hl1i1cmp761jgnyjfhagzi0iqq36qb41d8"))))
> -    ;; NOTE: mutter exports a bundled fork of cogl, so when making
> changes to
> -    ;; cogl, corresponding changes may be appropriate in mutter as
> well.
> +        (base32
> "0nfph4ai60ncdx7hy6hl1i1cmp761jgnyjfhagzi0iqq36qb41d8"))
> +       (patches
> +        (search-patches "cogl-fix-double-free.patch"))))
>      (build-system gnu-build-system)
>      (native-inputs
>       `(("glib:bin" ,glib "bin")     ; for glib-mkenums
> 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..e7a994b33a
> --- /dev/null
> +++ b/gnu/packages/patches/cogl-fix-double-free.patch
> @@ -0,0 +1,32 @@
> +From 15d0f7d96cf53263196e26f2eb48ededdff0efeb Mon Sep 17 00:00:00
> 2001
> +Message-ID:
> <15d0f7d96cf53263196e26f2eb48ededdff0efeb.1694148833.git.vivien <at> plane
> te-kraus.eu>
> +From: Vivien Kraus <vivien <at> planete-kraus.eu>
> +Date: Thu, 7 Sep 2023 22:16:48 +0200
> +Subject: [PATCH] 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 | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/cogl/cogl-context.c b/cogl/cogl-context.c
> +index a7eed29a..7cdc9fe7 100644
> +--- a/cogl/cogl-context.c
> ++++ b/cogl/cogl-context.c
> +@@ -218,7 +218,7 @@ cogl_context_new (CoglDisplay *display,
> +       return NULL;
> +     }
> + 
> +-  context->display = display;
> ++  context->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
> +
> +base-commit: 61d966c7442d521e38572b7f93ac7b8973a9c65e
> +-- 
> +2.41.0
> +
> 
> base-commit: baf5b0745446dabe8166d860996dc54cfa09db3e
LGTM, now waiting for CI to build it.

Cheers




This bug report was last modified 1 year and 252 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.