public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-libs/pulseaudio-qt/files/, media-libs/pulseaudio-qt/
@ 2022-11-11 23:17 Andreas Sturmlechner
  0 siblings, 0 replies; only message in thread
From: Andreas Sturmlechner @ 2022-11-11 23:17 UTC (permalink / raw
  To: gentoo-commits

commit:     00cc4d4088f38e0346529c276eeef1693a67d783
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 11 20:49:00 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Nov 11 23:16:59 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00cc4d40

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 <AT> gentoo.org>

 ...dio-qt-1.3-no-crash-if-no-server-response.patch | 44 ++++++++++++++++++++++
 .../pulseaudio-qt/pulseaudio-qt-1.3-r3.ebuild      | 36 ++++++++++++++++++
 2 files changed, 80 insertions(+)

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-11 23:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-11 23:17 [gentoo-commits] repo/gentoo:master commit in: media-libs/pulseaudio-qt/files/, media-libs/pulseaudio-qt/ Andreas Sturmlechner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox