Skip to content

Commit 1c78d92

Browse files
committed
fix: Architecture Avoid doing kill(-1) in QProcess destructor (loongarch64 Architecture)
1 parent 057be8a commit 1c78d92

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
qtbase-opensource-src (5.15.8-1+deepin4) unstable; urgency=medium
2+
3+
* Fix loongarch64 Architecture Avoid doing kill(-1) in QProcess destructor
4+
5+
-- LiChengGang <[email protected]> Tue, 30 Jan 2024 09:48:54 +0800
6+
17
qtbase-opensource-src (5.15.8-1+deepin3) unstable; urgency=medium
28

39
[ LiChengGang ]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Description: <Avoid doing kill(-1) in QProcess destructor>
2+
qtbase-opensource-src (5.15.8-1+deepin4) unstable; urgency=medium
3+
.
4+
[ LiChengGang ]
5+
* Fix loongarch64 Architecture Avoid doing kill(-1) in QProcess destructor
6+
Author: LiChengGang <[email protected]>
7+
8+
---
9+
https://bugreports.qt.io/browse/QTBUG-86285
10+
https://codereview.qt-project.org/c/qt/qtbase/+/319522
11+
Last-Update: 2024-01-30
12+
13+
--- qtbase-opensource-src-5.15.8.orig/src/corelib/io/qprocess_unix.cpp
14+
+++ qtbase-opensource-src-5.15.8/src/corelib/io/qprocess_unix.cpp
15+
@@ -506,7 +506,7 @@ void QProcessPrivate::startProcess()
16+
}
17+
18+
pid = Q_PID(childPid);
19+
-
20+
+ Q_ASSERT(pid > 0);
21+
// parent
22+
// close the ends we don't use and make all pipes non-blocking
23+
qt_safe_close(childStartedPipe[1]);
24+
@@ -696,7 +696,7 @@ void QProcessPrivate::terminateProcess()
25+
#if defined (QPROCESS_DEBUG)
26+
qDebug("QProcessPrivate::terminateProcess()");
27+
#endif
28+
- if (pid)
29+
+ if (pid > 0)
30+
::kill(pid_t(pid), SIGTERM);
31+
}
32+
33+
@@ -705,7 +705,7 @@ void QProcessPrivate::killProcess()
34+
#if defined (QPROCESS_DEBUG)
35+
qDebug("QProcessPrivate::killProcess()");
36+
#endif
37+
- if (pid)
38+
+ if (pid > 0)
39+
::kill(pid_t(pid), SIGKILL);
40+
}
41+

debian/patches/loongarch.diff

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Description: add support for LoongArch
2+
Origin: upstream, commits
3+
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=bdc16f086f1664b5
4+
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=0ab51dcc3c0cca0d
5+
Last-Update: 2024-01-30
6+
7+
--- qtbase-opensource-src-5.15.8.orig/src/corelib/global/archdetect.cpp
8+
+++ qtbase-opensource-src-5.15.8/src/corelib/global/archdetect.cpp
9+
@@ -59,6 +59,10 @@
10+
# define ARCH_PROCESSOR "x86_64"
11+
#elif defined(Q_PROCESSOR_IA64)
12+
# define ARCH_PROCESSOR "ia64"
13+
+#elif defined(Q_PROCESSOR_LOONGARCH_32)
14+
+# define ARCH_PROCESSOR "loongarch32"
15+
+#elif defined(Q_PROCESSOR_LOONGARCH_64)
16+
+# define ARCH_PROCESSOR "loongarch64"
17+
#elif defined(Q_PROCESSOR_MIPS_64)
18+
# define ARCH_PROCESSOR "mips64"
19+
#elif defined(Q_PROCESSOR_MIPS)
20+
--- qtbase-opensource-src-5.15.8.orig/src/corelib/global/qprocessordetection.h
21+
+++ qtbase-opensource-src-5.15.8/src/corelib/global/qprocessordetection.h
22+
@@ -227,6 +227,19 @@
23+
# define Q_PROCESSOR_IA64
24+
# define Q_PROCESSOR_WORDSIZE 8
25+
// Q_BYTE_ORDER not defined, use endianness auto-detection
26+
+ /*
27+
++ LoongArch family, known variants: 32- and 64-bit
28+
++
29+
++ LoongArch is little-endian.
30+
++*/
31+
+#elif defined(__loongarch__)
32+
+# define Q_PROCESSOR_LOONGARCH
33+
+# if __loongarch_grlen == 64
34+
+# define Q_PROCESSOR_LOONGARCH_64
35+
+# else
36+
+# define Q_PROCESSOR_LOONGARCH_32
37+
+# endif
38+
+# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
39+
40+
/*
41+
MIPS family, known revisions: I, II, III, IV, 32, 64

debian/patches/series

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@ QTBUG-101347-revert-xcb-implement-missing-bits-form-icccm414-WM_STATE-handling.p
6565
Add-some-error-handling-for-the-inotify-file-system-watcher.patch
6666
xcb-unset-states-and-set-new-ones-as-need.patch
6767
QTBUG-117950-Fix-XKB_KEY_dead_lowlin
68+
QTBUG-86285-Fix-kills-all-user-processes
69+
loongarch.diff

0 commit comments

Comments
 (0)