!49 [sync] PR-44: ukui-settings-daemon-3.1.2-kylin-fix-coredump

From: @openeuler-sync-bot 
Reviewed-by: @peijiankang 
Signed-off-by: @peijiankang
This commit is contained in:
openeuler-ci-bot 2023-09-15 09:42:07 +00:00 committed by Gitee
commit c85d667c1d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 68 additions and 1 deletions

View File

@ -0,0 +1,59 @@
diff -Naur ukui-settings-daemon-3.1.2/daemon/main.cpp ukui-settings-daemon-3.1.2~/daemon/main.cpp
--- ukui-settings-daemon-3.1.2/daemon/main.cpp 2022-04-15 11:36:50.000000000 +0800
+++ ukui-settings-daemon-3.1.2~/daemon/main.cpp 2023-07-06 17:50:20.704690501 +0800
@@ -31,7 +31,8 @@
#include <sys/types.h>
#include <signal.h>
-
+#include <syslog.h>
+#include <QTimer>
static void print_help ();
static void parse_args (int argc, char *argv[]);
static void stop_daemon ();
@@ -46,6 +47,15 @@
QApplication::exit(15);
}
+void handlerA(int no)
+{
+ USD_LOG(LOG_DEBUG,"catch SIGABRT signal, with exitcode %d",no);
+
+
+// manager->managerStop();
+ QApplication::exit(15);
+}
+
int main (int argc, char* argv[])
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
@@ -63,6 +73,7 @@
signal(SIGTERM, &handler);
+ signal(SIGABRT, &handlerA);
QApplication::setQuitOnLastWindowClosed(false);
QTranslator translator;
@@ -88,6 +99,21 @@
return 0;
}
+ QObject::connect(&app,&QCoreApplication::aboutToQuit,[&]{
+
+ //PluginManager::getInstance()->managerStop();
+ //managerStop()执行时间过长导致注销时所有插件未完全Daectivity就已经强行关闭系统最终导致SIGSEGV、SIGABRT
+
+ app.processEvents();
+ //QTimer timer;
+ // Wait until the event loop starts
+ QTimer::singleShot(500, [=](){
+
+ exit(0);
+ });
+
+ });
+
USD_LOG(LOG_INFO, "ukui-settings-daemon started!");
return app.exec();
}

View File

@ -1,12 +1,13 @@
Name: ukui-settings-daemon
Version: 3.1.2
Release: 4
Release: 5
Summary: daemon handling the UKUI session settings
License: GPL-2.0-or-later and GPL-3.0-or-later and LGPL-2.0-or-later
URL: http://www.ukui.org
Source0: %{name}-%{version}.tar.gz
Patch1: 0001-modify-compile-error-of-ukui-settings-daemon.patch
Patch2: Fix-the-failure-of-shortcut-key-to-open-terminal.patch
Patch4: ukui-settings-daemon-3.1.2-kylin-fix-coredump.patch
BuildRequires: pkgconf-pkg-config
BuildRequires: intltool
@ -88,6 +89,7 @@ Summary: daemon handling the UKUI session settings (common files)
%setup -q
%patch1 -p1
%patch2 -p1
%patch4 -p1
%build
%{qmake_qt5}
@ -133,6 +135,12 @@ glib-compile-schemas /usr/share/glib-2.0/schemas/ &> /dev/null || :
%changelog
* Mon Jul 10 2023 huayadong <huayadong@kylinos.cn> - 3.1.0-5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add Patch4:ukui-settings-daemon-3.1.2-kylin-fix-coredump.patch
* Sun Jun 25 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.2-4
- Type:bugfix
- ID:NA