summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2022-11-11 21:49:00 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2022-11-12 00:16:59 +0100
commit00cc4d4088f38e0346529c276eeef1693a67d783 (patch)
tree11f92d0c47b13767ac52a68bcb861b0bc11a4a6f /media-libs/pulseaudio-qt
parentsci-libs/lapack: Stabilize 3.10.1 ppc, #881027 (diff)
downloadgentoo-00cc4d4088f38e0346529c276eeef1693a67d783.tar.gz
gentoo-00cc4d4088f38e0346529c276eeef1693a67d783.tar.bz2
gentoo-00cc4d4088f38e0346529c276eeef1693a67d783.zip
media-libs/pulseaudio-qt: Don't crash when the server doesn't respond
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=454647 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'media-libs/pulseaudio-qt')
-rw-r--r--media-libs/pulseaudio-qt/files/pulseaudio-qt-1.3-no-crash-if-no-server-response.patch44
-rw-r--r--media-libs/pulseaudio-qt/pulseaudio-qt-1.3-r3.ebuild36
2 files changed, 80 insertions, 0 deletions
diff --git a/media-libs/pulseaudio-qt/files/pulseaudio-qt-1.3-no-crash-if-no-server-response.patch b/media-libs/pulseaudio-qt/files/pulseaudio-qt-1.3-no-crash-if-no-server-response.patch
new file mode 100644
index 000000000000..459319aa49b8
--- /dev/null
+++ b/media-libs/pulseaudio-qt/files/pulseaudio-qt-1.3-no-crash-if-no-server-response.patch
@@ -0,0 +1,44 @@
+From f6b02f21a9131bafc4965ebb64acf01a4505ce04 Mon Sep 17 00:00:00 2001
+From: Harald Sitter <sitter@kde.org>
+Date: Mon, 10 Oct 2022 16:06:20 +0200
+Subject: [PATCH] don't crash when the server doesn't respond
+
+inside libpulse a non-reply (e.g. caused by a timeout) results in info
+being a nullptr. when that happens simply skip over the callback. when
+this happens chances are the server crashed or is otherwise defunct so
+we won't be able to do much about this anyway
+
+easy to test by attaching to both plasmashell and pulseaudio and
+interrupting the latter when the former calls
+pa_context_get_server_info. this results in the reply timeout getting
+hit -> nullptr callback.
+
+it is unclear if we can somehow recover from this but in lieu of a
+reliable real world test case for this we at least shouldn't crash on
+nullptr access.
+
+BUG: 454647
+---
+ src/context.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/context.cpp b/src/context.cpp
+index 604364f..c5a0f10 100644
+--- a/src/context.cpp
++++ b/src/context.cpp
+@@ -161,6 +161,12 @@ static void server_cb(pa_context *context, const pa_server_info *info, void *dat
+ {
+ Q_ASSERT(context);
+ Q_ASSERT(data);
++ if (!info) {
++ // info may be nullptr when e.g. the server doesn't reply in time (e.g. it is stuck)
++ // https://bugs.kde.org/show_bug.cgi?id=454647
++ qCWarning(PULSEAUDIOQT) << "server_cb() called without info!";
++ return;
++ }
+ static_cast<ContextPrivate *>(data)->serverCallback(info);
+ }
+
+--
+GitLab
+
diff --git a/media-libs/pulseaudio-qt/pulseaudio-qt-1.3-r3.ebuild b/media-libs/pulseaudio-qt/pulseaudio-qt-1.3-r3.ebuild
new file mode 100644
index 000000000000..07b4aa658b02
--- /dev/null
+++ b/media-libs/pulseaudio-qt/pulseaudio-qt-1.3-r3.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_HANDBOOK="forceoptional"
+ECM_QTHELP="true"
+ECM_TEST="optional"
+QTMIN=5.15.2
+inherit ecm kde.org
+
+DESCRIPTION="Qt bindings for libpulse"
+HOMEPAGE="https://invent.kde.org/libraries/pulseaudio-qt"
+
+if [[ ${KDE_BUILD_TYPE} = release ]]; then
+ SRC_URI="mirror://kde/stable/${PN}/${P}.tar.xz"
+ KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0/3"
+
+RDEPEND="
+ >=dev-qt/qtdbus-${QTMIN}:5
+ >=dev-qt/qtgui-${QTMIN}:5
+ media-libs/libpulse
+"
+DEPEND="${RDEPEND}
+ test? (
+ >=dev-qt/qtdeclarative-${QTMIN}:5
+ >=dev-qt/qtquickcontrols2-${QTMIN}:5
+ )
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}/${P}-no-crash-if-no-server-response.patch" ) # KDE-bug 454647