summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2021-12-15 10:06:15 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2021-12-15 10:38:12 +0100
commit88d68008b9979f7235ed225b70030a26e07ffcaf (patch)
tree727ba114d9131823367a6d9feaf943fa912c752d /kde-plasma
parentdev-ros/urdf: add := dep on urdfdom (diff)
downloadgentoo-88d68008b9979f7235ed225b70030a26e07ffcaf.tar.gz
gentoo-88d68008b9979f7235ed225b70030a26e07ffcaf.tar.bz2
gentoo-88d68008b9979f7235ed225b70030a26e07ffcaf.zip
kde-plasma/libksysguard: Fix segfault in process list tree view mode
Reported-by: Eric F. Garioud <eric-f.garioud@wanadoo.fr> Bug: https://bugs.gentoo.org/446534 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-plasma')
-rw-r--r--kde-plasma/libksysguard/files/libksysguard-5.23.4-fix-segfault.patch76
-rw-r--r--kde-plasma/libksysguard/libksysguard-5.23.4-r1.ebuild79
2 files changed, 155 insertions, 0 deletions
diff --git a/kde-plasma/libksysguard/files/libksysguard-5.23.4-fix-segfault.patch b/kde-plasma/libksysguard/files/libksysguard-5.23.4-fix-segfault.patch
new file mode 100644
index 000000000000..f37fbf60bf81
--- /dev/null
+++ b/kde-plasma/libksysguard/files/libksysguard-5.23.4-fix-segfault.patch
@@ -0,0 +1,76 @@
+From 311faef0ef0e5f60eebed2a5a00c43f5cb60aab1 Mon Sep 17 00:00:00 2001
+From: Fabian Vogt <fabian@ritter-vogt.de>
+Date: Tue, 7 Dec 2021 22:23:17 +0100
+Subject: [PATCH] Handle process parent changes in ProcessDataModel
+
+When the PPID of a process changes, it moves around in the model, changing the
+layout. This needs to be announced properly, otherwise users of the model get
+confused, leading to weird behaviour and crashes.
+
+The added code is pretty much a direct copy from ProcessModel.
+
+BUG: 446534
+
+
+(cherry picked from commit a0d70929a1b5e38bd8bf61e1895321124acf03a7)
+---
+ processcore/process_data_model.cpp | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+
+diff --git a/processcore/process_data_model.cpp b/processcore/process_data_model.cpp
+index 172ce7f..f776372 100644
+--- a/processcore/process_data_model.cpp
++++ b/processcore/process_data_model.cpp
+@@ -24,6 +24,8 @@ public:
+ Private(ProcessDataModel *q);
+ void beginInsertRow(KSysGuard::Process *parent);
+ void endInsertRow();
++ void beginMoveProcess(KSysGuard::Process *process, KSysGuard::Process *new_parent);
++ void endMoveProcess();
+ void beginRemoveRow(KSysGuard::Process *process);
+ void endRemoveRow();
+
+@@ -65,6 +67,12 @@ ProcessDataModel::Private::Private(ProcessDataModel *_q)
+ connect(m_processes.get(), &KSysGuard::Processes::endAddProcess, q, [this]() {
+ endInsertRow();
+ });
++ connect(m_processes.get(), &KSysGuard::Processes::beginMoveProcess, q, [this](KSysGuard::Process *process, KSysGuard::Process *new_parent) {
++ beginMoveProcess(process, new_parent);
++ });
++ connect(m_processes.get(), &KSysGuard::Processes::endMoveProcess, q, [this]() {
++ endMoveProcess();
++ });
+ connect(m_processes.get(), &KSysGuard::Processes::beginRemoveProcess, q, [this](KSysGuard::Process *process) {
+ beginRemoveRow(process);
+ });
+@@ -335,6 +343,27 @@ void ProcessDataModel::Private::endRemoveRow()
+ q->endRemoveRows();
+ }
+
++void ProcessDataModel::Private::beginMoveProcess(KSysGuard::Process *process, KSysGuard::Process *new_parent)
++{
++ if (m_flatList)
++ return; // We don't need to move processes when in simple mode
++
++ int current_row = process->parent()->children().indexOf(process);
++ Q_ASSERT(current_row != -1);
++ int new_row = new_parent->children().count();
++ QModelIndex sourceParent = getQModelIndex(process->parent(), 0);
++ QModelIndex destinationParent = getQModelIndex(new_parent, 0);
++ q->beginMoveRows(sourceParent, current_row, current_row, destinationParent, new_row);
++}
++
++void ProcessDataModel::Private::endMoveProcess()
++{
++ if (m_flatList)
++ return; // We don't need to move processes when in simple mode
++
++ q->endMoveRows();
++}
++
+ void ProcessDataModel::Private::update()
+ {
+ Processes::UpdateFlags flags;
+--
+GitLab
+
diff --git a/kde-plasma/libksysguard/libksysguard-5.23.4-r1.ebuild b/kde-plasma/libksysguard/libksysguard-5.23.4-r1.ebuild
new file mode 100644
index 000000000000..a2127dcf2c23
--- /dev/null
+++ b/kde-plasma/libksysguard/libksysguard-5.23.4-r1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_DESIGNERPLUGIN="true"
+ECM_TEST="true"
+KFMIN=5.86.0
+QTMIN=5.15.2
+VIRTUALX_REQUIRED="test"
+inherit ecm kde.org
+
+DESCRIPTION="Task management and system monitoring library"
+
+LICENSE="LGPL-2+"
+SLOT="5/9"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="webengine X"
+
+COMMON_DEPEND="
+ dev-libs/libnl:3
+ >=dev-qt/qtdbus-${QTMIN}:5
+ >=dev-qt/qtdeclarative-${QTMIN}:5
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtnetwork-${QTMIN}:5
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=kde-frameworks/kauth-${KFMIN}:5
+ >=kde-frameworks/kcompletion-${KFMIN}:5
+ >=kde-frameworks/kconfig-${KFMIN}:5
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5
+ >=kde-frameworks/kdeclarative-${KFMIN}:5
+ >=kde-frameworks/ki18n-${KFMIN}:5
+ >=kde-frameworks/kjobwidgets-${KFMIN}:5
+ >=kde-frameworks/knewstuff-${KFMIN}:5
+ >=kde-frameworks/kpackage-${KFMIN}:5
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+ >=kde-frameworks/kwindowsystem-${KFMIN}:5
+ net-libs/libpcap
+ sys-apps/lm-sensors:=
+ sys-libs/libcap
+ sys-libs/zlib
+ webengine? (
+ >=dev-qt/qtwebchannel-${QTMIN}:5
+ >=dev-qt/qtwebengine-${QTMIN}:5
+ )
+ X? (
+ >=dev-qt/qtx11extras-${QTMIN}:5
+ x11-libs/libX11
+ x11-libs/libXres
+ )
+"
+DEPEND="${COMMON_DEPEND}
+ >=kde-frameworks/kiconthemes-${KFMIN}:5
+ X? ( x11-base/xorg-proto )
+"
+RDEPEND="${COMMON_DEPEND}
+ !<kde-plasma/ksysguard-5.21.90:5
+ !<kde-plasma/plasma-workspace-5.18.80:5
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.22.80-no-detailed-mem-message.patch" # downstream
+ "${FILESDIR}/${P}-fix-segfault.patch" # KDE-bug 446534
+)
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake_use_find_package webengine Qt5WebChannel)
+ $(cmake_use_find_package webengine Qt5WebEngineWidgets)
+ $(cmake_use_find_package X X11)
+ )
+
+ ecm_src_configure
+}
+
+src_test() {
+ LC_NUMERIC="C" ecm_src_test # bug 695514
+}