[Pkg-utopia-maintainers] Bug#1015915: pipewire-pulse leaking memory
Vuk Mirovic
contact at vukmirovic.org
Fri Oct 6 01:18:26 BST 2023
Package: pipewire
Version: 0.3.65-3
Followup-For: Bug #1015915
Dear Maintainer,
Longstanding memory leak was finally fixed upstream.
Here is the upstream issue for context: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1840
Commits fixing the issue:
https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/7e2f6757fcc4eefd29cb47d8292714ac8014b9ef
https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/8680c74d1bd83b4969c9305171076b36f56d82fa
I made a patch for 0.3.65-3:
Index: pipewire-0.3.65/meson.build
===================================================================
--- pipewire-0.3.65.orig/meson.build
+++ pipewire-0.3.65/meson.build
@@ -401,6 +401,7 @@ check_functions = [
['reallocarray', '#include <stdlib.h>', ['-D_GNU_SOURCE'], []],
['sigabbrev_np', '#include <string.h>', ['-D_GNU_SOURCE'], []],
['XSetIOErrorExitHandler', '#include <X11/Xlib.h>', [], [x11_dep]],
+ ['malloc_trim', '#include <malloc.h>', [], []],
]
foreach f : check_functions
Index: pipewire-0.3.65/src/pipewire/impl-node.c
===================================================================
--- pipewire-0.3.65.orig/src/pipewire/impl-node.c
+++ pipewire-0.3.65/src/pipewire/impl-node.c
@@ -28,6 +28,7 @@
#include <unistd.h>
#include <errno.h>
#include <time.h>
+#include <malloc.h>
#include <spa/support/system.h>
#include <spa/pod/parser.h>
@@ -1945,6 +1946,11 @@ void pw_impl_node_destroy(struct pw_impl
spa_system_close(context->data_system, node->source.fd);
free(impl);
+
+#ifdef HAVE_MALLOC_TRIM
+ int res = malloc_trim(0);
+ pw_log_debug("malloc_trim(): %d", res);
+#endif
}
SPA_EXPORT
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
* What exactly did you do (or not do) that was effective (or
ineffective)?
* What was the outcome of this action?
* What outcome did you expect instead?
*** End of the template - remove these template lines ***
-- System Information:
Debian Release: 12.1
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable'), (10, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 6.1.0-12-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages pipewire depends on:
ii adduser 3.134
ii init-system-helpers 1.65.2
ii libpipewire-0.3-modules 0.3.65-3
ii pipewire-bin 0.3.65-3
pipewire recommends no packages.
pipewire suggests no packages.
-- no debconf information
More information about the Pkg-utopia-maintainers
mailing list