--- Begin Message ---
Package: release.debian.org
Severity: normal
Tags: bookworm
User: release.debian....@packages.debian.org
Usertags: pu
X-Debbugs-Cc: mate-session-mana...@packages.debian.org
Control: affects -1 + src:mate-session-manager
[ Reason ]
Memory leak fixes, CLUTTER_BACKEND env variable mitigation (when
switching between MATE and GNOME for the same user).
[ Impact ]
Less memory leakage in MATE desktop session. Mitigation of clutter
backend issue when switching between MATE and any other non-X11
desktop.
[ Tests ]
Code review, manual tests on bookworm system.
[ Risks ]
Regression in MATE for clutter based applications possible. Regression
in MATE session possible.
[ Checklist ]
[x] *all* changes are documented in the d/changelog
[x] I reviewed all changes and I approve them
[x] attach debdiff against the package in (old)stable
[x] the issue is verified as fixed in unstable
[ Changes ]
+ * debian/patches:
+ + Add 0007_Fix-memory-leaks-284.patch and 0008_mate-session-fix-memory-
+ leak.patch. Fix various memory leaks. (Closes: #1038638).
+ + Cherry-pick 0009_main-fix-double-free-on-gl_renderer.patch from
upstream's
+ 1.26 branch. Regression fix for 0008_mate-session-fix-memory-leak.patch.
+ * debian/default-settings/X11/Xsession.d/99mate-environment:
+ + Allow clutter backends other than x11 (while preferring x11). (Closes:
+ #954783).
[ Other info ]
None.
diff -Nru mate-session-manager-1.26.0/debian/changelog
mate-session-manager-1.26.0/debian/changelog
--- mate-session-manager-1.26.0/debian/changelog 2021-12-11
17:47:23.000000000 +0100
+++ mate-session-manager-1.26.0/debian/changelog 2023-06-20
08:10:18.000000000 +0200
@@ -1,3 +1,16 @@
+mate-session-manager (1.26.0-1+deb12u1) bookworm; urgency=medium
+
+ * debian/patches:
+ + Add 0007_Fix-memory-leaks-284.patch and 0008_mate-session-fix-memory-
+ leak.patch. Fix various memory leaks. (Closes: #1038638).
+ + Cherry-pick 0009_main-fix-double-free-on-gl_renderer.patch from
upstream's
+ 1.26 branch. Regression fix for 0008_mate-session-fix-memory-leak.patch.
+ * debian/default-settings/X11/Xsession.d/99mate-environment:
+ + Allow clutter backends other than x11 (while preferring x11). (Closes:
+ #954783).
+
+ -- Mike Gabriel <sunwea...@debian.org> Tue, 20 Jun 2023 08:10:18 +0200
+
mate-session-manager (1.26.0-1) unstable; urgency=medium
[ Martin Wimpress ]
diff -Nru
mate-session-manager-1.26.0/debian/default-settings/X11/Xsession.d/99mate-environment
mate-session-manager-1.26.0/debian/default-settings/X11/Xsession.d/99mate-environment
---
mate-session-manager-1.26.0/debian/default-settings/X11/Xsession.d/99mate-environment
2018-10-27 14:33:57.000000000 +0200
+++
mate-session-manager-1.26.0/debian/default-settings/X11/Xsession.d/99mate-environment
2023-06-20 08:10:18.000000000 +0200
@@ -33,6 +33,6 @@
# - Telegram doesn't work with QT_STYLE_OVERRIDE=gtk
# export QT_STYLE_OVERRIDE=gtk
- # Workaround clutter issue (LP: #1462445)
- export CLUTTER_BACKEND=x11
+ # Workaround clutter issue (LP: #1462445, Debian #954783)
+ export CLUTTER_BACKEND="x11,*"
fi
diff -Nru
mate-session-manager-1.26.0/debian/patches/0007_Fix-memory-leaks-284.patch
mate-session-manager-1.26.0/debian/patches/0007_Fix-memory-leaks-284.patch
--- mate-session-manager-1.26.0/debian/patches/0007_Fix-memory-leaks-284.patch
1970-01-01 01:00:00.000000000 +0100
+++ mate-session-manager-1.26.0/debian/patches/0007_Fix-memory-leaks-284.patch
2023-06-19 15:15:23.000000000 +0200
@@ -0,0 +1,54 @@
+From 7b09df2f9a5ddf27b4c4458e6f8cb3ad701ee24d Mon Sep 17 00:00:00 2001
+From: Robert Antoni Buj Gelonch <r...@users.noreply.github.com>
+Date: Sat, 20 Aug 2022 02:19:30 +0200
+Subject: [PATCH 1/2] Fix memory leaks (#284)
+
+Signed-off-by: Mike Gabriel <mike.gabr...@das-netzwerkteam.de>
+---
+ tools/mate-session-check-accelerated-gl-helper.c | 1 +
+ tools/mate-session-check-accelerated-gles-helper.c | 2 ++
+ tools/mate-session-check-accelerated.c | 1 +
+ 3 files changed, 4 insertions(+)
+
+diff --git a/tools/mate-session-check-accelerated-gl-helper.c
b/tools/mate-session-check-accelerated-gl-helper.c
+index 9c1cc0b..5c1e8d9 100644
+--- a/tools/mate-session-check-accelerated-gl-helper.c
++++ b/tools/mate-session-check-accelerated-gl-helper.c
+@@ -510,6 +510,7 @@ main (int argc, char **argv)
+ out:
+ if (display)
+ XCloseDisplay (display);
++ g_option_context_free (context);
+ g_free (renderer);
+
+ return ret;
+diff --git a/tools/mate-session-check-accelerated-gles-helper.c
b/tools/mate-session-check-accelerated-gles-helper.c
+index e6312c6..d5ad808 100644
+--- a/tools/mate-session-check-accelerated-gles-helper.c
++++ b/tools/mate-session-check-accelerated-gles-helper.c
+@@ -226,8 +226,10 @@ main (int argc,
+ else
+ ret = HELPER_ACCEL;
+ }
++ g_free (renderer);
+ #endif
+
+ out:
++ g_option_context_free (context);
+ return ret;
+ }
+diff --git a/tools/mate-session-check-accelerated.c
b/tools/mate-session-check-accelerated.c
+index 6fe6ec4..70095f5 100644
+--- a/tools/mate-session-check-accelerated.c
++++ b/tools/mate-session-check-accelerated.c
+@@ -158,6 +158,7 @@ main (int argc, char **argv)
+ renderer_string = get_gtk_gles_renderer ();
+ if (renderer_string) {
+ g_print ("%s", renderer_string);
++ g_free (renderer_string);
+ return 0;
+ }
+ return 1;
+--
+2.39.2
+
diff -Nru
mate-session-manager-1.26.0/debian/patches/0008_mate-session-fix-memory-leak.patch
mate-session-manager-1.26.0/debian/patches/0008_mate-session-fix-memory-leak.patch
---
mate-session-manager-1.26.0/debian/patches/0008_mate-session-fix-memory-leak.patch
1970-01-01 01:00:00.000000000 +0100
+++
mate-session-manager-1.26.0/debian/patches/0008_mate-session-fix-memory-leak.patch
2023-06-19 15:15:23.000000000 +0200
@@ -0,0 +1,111 @@
+From 1bc90279ce1c094c0036077917ac7b93f5cb4007 Mon Sep 17 00:00:00 2001
+From: rbuj <robert....@gmail.com>
+Date: Sat, 23 Oct 2021 11:18:52 +0200
+Subject: [PATCH 2/2] mate-session: fix memory leak
+
+Signed-off-by: Mike Gabriel <mike.gabr...@das-netzwerkteam.de>
+---
+ mate-session/gsm-manager.c | 8 ++++++--
+ mate-session/main.c | 11 ++++++-----
+ 2 files changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c
+index 9b5374e..47108d0 100644
+--- a/mate-session/gsm-manager.c
++++ b/mate-session/gsm-manager.c
+@@ -145,7 +145,7 @@ typedef struct {
+ GSettings *settings_lockdown;
+ GSettings *settings_screensaver;
+
+- const char *renderer;
++ char *renderer;
+
+ DBusGProxy *bus_proxy;
+ DBusGConnection *connection;
+@@ -1697,7 +1697,8 @@ _gsm_manager_set_renderer (GsmManager *manager,
+ {
+ GsmManagerPrivate *priv;
+ priv = gsm_manager_get_instance_private (manager);
+- priv->renderer = renderer;
++ g_free (priv->renderer);
++ priv->renderer = g_strdup (renderer);
+ }
+
+ static gboolean
+@@ -2660,6 +2661,9 @@ gsm_manager_dispose (GObject *object)
+ g_object_unref (priv->settings_screensaver);
+ priv->settings_screensaver = NULL;
+ }
++
++ g_clear_pointer (&priv->renderer, g_free);
++
+ G_OBJECT_CLASS (gsm_manager_parent_class)->dispose (object);
+ }
+
+diff --git a/mate-session/main.c b/mate-session/main.c
+index 96c1092..fc2148e 100644
+--- a/mate-session/main.c
++++ b/mate-session/main.c
+@@ -83,7 +83,6 @@ static gboolean failsafe = FALSE;
+ static gboolean show_version = FALSE;
+ static gboolean debug = FALSE;
+ static gboolean disable_acceleration_check = FALSE;
+-static char *gl_renderer = NULL;
+
+ static gboolean
+ initialize_gsettings (void)
+@@ -575,7 +574,7 @@ static void set_overlay_scroll (void)
+ }
+
+ static gboolean
+-check_gl (GError **error)
++check_gl (gchar **gl_renderer, GError **error)
+ {
+ int status;
+ char *argv[] = { LIBEXECDIR "/mate-session-check-accelerated", NULL };
+@@ -585,7 +584,7 @@ check_gl (GError **error)
+ return TRUE;
+ }
+
+- if (!g_spawn_sync (NULL, (char **) argv, NULL, 0, NULL, NULL,
&gl_renderer, NULL,
++ if (!g_spawn_sync (NULL, (char **) argv, NULL, 0, NULL, NULL,
gl_renderer, NULL,
+ &status, error)) {
+ return FALSE;
+ }
+@@ -605,6 +604,7 @@ int main(int argc, char** argv)
+ GSettings* accessibility_settings;
+ MdmSignalHandler* signal_handler;
+ static char** override_autostart_dirs = NULL;
++ char* gl_renderer = NULL;
+ gboolean gl_failed = FALSE;
+
+ static GOptionEntry entries[] = {
+@@ -670,7 +670,7 @@ int main(int argc, char** argv)
+ g_debug ("hardware acceleration check is disabled");
+ } else {
+ /* Check GL, if it doesn't work out then force software
fallback */
+- if (!check_gl (&error)) {
++ if (!check_gl (&gl_renderer, &error)) {
+ gl_failed = TRUE;
+
+ g_debug ("hardware acceleration check failed: %s",
+@@ -678,7 +678,7 @@ int main(int argc, char** argv)
+ g_clear_error (&error);
+ if (g_getenv ("LIBGL_ALWAYS_SOFTWARE") == NULL) {
+ g_setenv ("LIBGL_ALWAYS_SOFTWARE", "1", TRUE);
+- if (!check_gl (&error)) {
++ if (!check_gl (&gl_renderer, &error)) {
+ g_warning ("software acceleration check
failed: %s",
+ error? error->message : "");
+ g_clear_error (&error);
+@@ -759,6 +759,7 @@ int main(int argc, char** argv)
+
+ gsm_xsmp_server_start(xsmp_server);
+ _gsm_manager_set_renderer (manager, gl_renderer);
++ g_free (gl_renderer);
+ gsm_manager_start(manager);
+
+ gtk_main();
+--
+2.39.2
+
diff -Nru
mate-session-manager-1.26.0/debian/patches/0009_main-fix-double-free-on-gl_renderer.patch
mate-session-manager-1.26.0/debian/patches/0009_main-fix-double-free-on-gl_renderer.patch
---
mate-session-manager-1.26.0/debian/patches/0009_main-fix-double-free-on-gl_renderer.patch
1970-01-01 01:00:00.000000000 +0100
+++
mate-session-manager-1.26.0/debian/patches/0009_main-fix-double-free-on-gl_renderer.patch
2023-06-19 15:15:20.000000000 +0200
@@ -0,0 +1,27 @@
+From 1deb34ac81817da45b1e1d0c80f2bb4954a4253e Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpa...@fastmail.com>
+Date: Sun, 21 May 2023 00:30:29 +0200
+Subject: [PATCH] main: fix double free on gl_renderer
+
+Fixes: 1263384 ("mate-session: fix memory leak")
+Fixes: #304
+Signed-off-by: Mike Gabriel <mike.gabr...@das-netzwerkteam.de>
+---
+ mate-session/main.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/mate-session/main.c b/mate-session/main.c
+index fc2148e..68e3864 100644
+--- a/mate-session/main.c
++++ b/mate-session/main.c
+@@ -759,7 +759,6 @@ int main(int argc, char** argv)
+
+ gsm_xsmp_server_start(xsmp_server);
+ _gsm_manager_set_renderer (manager, gl_renderer);
+- g_free (gl_renderer);
+ gsm_manager_start(manager);
+
+ gtk_main();
+--
+2.39.2
+
diff -Nru mate-session-manager-1.26.0/debian/patches/series
mate-session-manager-1.26.0/debian/patches/series
--- mate-session-manager-1.26.0/debian/patches/series 2021-12-11
17:47:23.000000000 +0100
+++ mate-session-manager-1.26.0/debian/patches/series 2023-06-19
15:17:36.000000000 +0200
@@ -1,2 +1,5 @@
0005_lock-session-before-user-switch.patch
0006_util-Blacklist-some-session-specific-variables.patch
+0007_Fix-memory-leaks-284.patch
+0008_mate-session-fix-memory-leak.patch
+0009_main-fix-double-free-on-gl_renderer.patch
--- End Message ---