ukui-settings-daemon/ukui-settings-daemon-3.1.2-kylin-fix-coredump.patch
peijiankang d48e2081c0 ukui-settings-daemon-3.1.2-kylin-fix-coredump
(cherry picked from commit 06c7d9dfa0762356cfe58a1e8bb11b53f8fa58ab)
2023-09-15 16:55:12 +08:00

60 lines
1.5 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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();
}