summaryrefslogtreecommitdiff
path: root/source/l/qt5/patches/qt5.qlockfile-deadlock.patch
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2020-02-15 02:42:28 +0000
committerEric Hameleers <alien@slackware.com>2020-02-15 08:59:47 +0100
commit7cde3ca9e7c5de666cc607e737f984a52f94e021 (patch)
tree9625b6c02d0dad1e8cc40f9713b2c1d4919d011a /source/l/qt5/patches/qt5.qlockfile-deadlock.patch
parentbea4af160dc640549e07144b9a0dddf09b569861 (diff)
downloadcurrent-7cde3ca9e7c5de666cc607e737f984a52f94e021.tar.gz
Sat Feb 15 02:42:28 UTC 202020200215024228
a/kernel-generic-5.4.20-x86_64-1.txz: Upgraded. a/kernel-huge-5.4.20-x86_64-1.txz: Upgraded. a/kernel-modules-5.4.20-x86_64-1.txz: Upgraded. a/shadow-4.8.1-x86_64-3.txz: Rebuilt. a/util-linux-2.35.1-x86_64-3.txz: Rebuilt. d/kernel-headers-5.4.20-x86-1.txz: Upgraded. k/kernel-source-5.4.20-noarch-1.txz: Upgraded. l/ConsoleKit2-1.2.1-x86_64-2.txz: Rebuilt. l/dconf-editor-3.34.4-x86_64-1.txz: Upgraded. l/libxkbcommon-0.10.0-x86_64-1.txz: Added. l/openal-soft-1.19.1-x86_64-1.txz: Added. l/qt5-5.13.2-x86_64-1.txz: Added. Thanks to alienBOB. n/openssh-8.2p1-x86_64-1.txz: Upgraded. Potentially incompatible changes: * ssh(1), sshd(8): the removal of "ssh-rsa" from the accepted CASignatureAlgorithms list. * ssh(1), sshd(8): this release removes diffie-hellman-group14-sha1 from the default key exchange proposal for both the client and server. * ssh-keygen(1): the command-line options related to the generation and screening of safe prime numbers used by the diffie-hellman-group-exchange-* key exchange algorithms have changed. Most options have been folded under the -O flag. * sshd(8): the sshd listener process title visible to ps(1) has changed to include information about the number of connections that are currently attempting authentication and the limits configured by MaxStartups. x/mesa-19.3.4-x86_64-2.txz: Rebuilt. Reverted "[PATCH] swr: Fix GCC 4.9 checks." which makes X fail to start with an illegal instruction on some hardware. isolinux/initrd.img: Rebuilt. kernels/*: Upgraded. testing/packages/PAM/ConsoleKit2-1.2.1-x86_64-2_pam.txz: Rebuilt. Rebuilt with --disable-libcgmanager to fix setting limits on PAM. Thanks to gattocarlo. testing/packages/PAM/openssh-8.2p1-x86_64-1_pam.txz: Upgraded. testing/packages/PAM/shadow-4.8.1-x86_64-3_pam.txz: Rebuilt. Moved some of the /etc/pam.d/ file to the util-linux package where they more properly belong. testing/packages/PAM/util-linux-2.35.1-x86_64-3_pam.txz: Rebuilt. Added some /etc/pam.d/ files previously in the shadow package. Changed /etc/pam.d/{chfn,chsh} and made chfn/chsh setuid root to fix them. Added /etc/pam.d/{runuser,runuser-l}. usb-and-pxe-installers/usbboot.img: Rebuilt.
Diffstat (limited to 'source/l/qt5/patches/qt5.qlockfile-deadlock.patch')
-rw-r--r--source/l/qt5/patches/qt5.qlockfile-deadlock.patch116
1 files changed, 116 insertions, 0 deletions
diff --git a/source/l/qt5/patches/qt5.qlockfile-deadlock.patch b/source/l/qt5/patches/qt5.qlockfile-deadlock.patch
new file mode 100644
index 00000000..e51d5ad0
--- /dev/null
+++ b/source/l/qt5/patches/qt5.qlockfile-deadlock.patch
@@ -0,0 +1,116 @@
+# Taken from:
+# https://projects.archlinux.org/svntogit/packages.git/plain/trunk/qlockfile-deadlock.patch?h=packages/qt5
+# QTBUG-44771
+# ----------------------------------------------------------------------------
+From f58e882b7594c59b6050d3c87562fcf836d10f60 Mon Sep 17 00:00:00 2001
+From: Olivier Goffart <ogoffart@woboq.com>
+Date: Tue, 14 Apr 2015 10:58:26 +0200
+Subject: QLockFile: fix deadlock when the lock file is corrupted
+
+[ChangeLog][QtCore][QLockFile] Fixed a deadlock when the lock file
+is corrupted.
+
+Task-number: QTBUG-44771
+Change-Id: Ic490b09d70ff1cc1733b64949889a73720b2d0f3
+Reviewed-by: David Faure <david.faure@kdab.com>
+---
+ src/corelib/io/qlockfile_unix.cpp | 10 +++++-----
+ src/corelib/io/qlockfile_win.cpp | 22 +++++++++++-----------
+ tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp | 17 +++++++++++++++++
+ 3 files changed, 33 insertions(+), 16 deletions(-)
+
+diff --git a/qtbase/src/corelib/io/qlockfile_unix.cpp b/qtbase/src/corelib/io/qlockfile_unix.cpp
+index bf1015a..dc9f8f7 100644
+--- a/qtbase/src/corelib/io/qlockfile_unix.cpp
++++ b/qtbase/src/corelib/io/qlockfile_unix.cpp
+@@ -181,11 +181,11 @@ bool QLockFilePrivate::isApparentlyStale() const
+ {
+ qint64 pid;
+ QString hostname, appname;
+- if (!getLockInfo(&pid, &hostname, &appname))
+- return false;
+- if (hostname.isEmpty() || hostname == QString::fromLocal8Bit(localHostName())) {
+- if (::kill(pid, 0) == -1 && errno == ESRCH)
+- return true; // PID doesn't exist anymore
++ if (getLockInfo(&pid, &hostname, &appname)) {
++ if (hostname.isEmpty() || hostname == QString::fromLocal8Bit(localHostName())) {
++ if (::kill(pid, 0) == -1 && errno == ESRCH)
++ return true; // PID doesn't exist anymore
++ }
+ }
+ const qint64 age = QFileInfo(fileName).lastModified().msecsTo(QDateTime::currentDateTime());
+ return staleLockTime > 0 && age > staleLockTime;
+diff --git a/qtbase/src/corelib/io/qlockfile_win.cpp b/qtbase/src/corelib/io/qlockfile_win.cpp
+index f9f2909..3587c7b 100644
+--- a/qtbase/src/corelib/io/qlockfile_win.cpp
++++ b/qtbase/src/corelib/io/qlockfile_win.cpp
+@@ -115,21 +115,21 @@ bool QLockFilePrivate::isApparentlyStale() const
+ {
+ qint64 pid;
+ QString hostname, appname;
+- if (!getLockInfo(&pid, &hostname, &appname))
+- return false;
+
+ // On WinRT there seems to be no way of obtaining information about other
+ // processes due to sandboxing
+ #ifndef Q_OS_WINRT
+- if (hostname == QString::fromLocal8Bit(localHostName())) {
+- HANDLE procHandle = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
+- if (!procHandle)
+- return true;
+- // We got a handle but check if process is still alive
+- DWORD dwR = ::WaitForSingleObject(procHandle, 0);
+- ::CloseHandle(procHandle);
+- if (dwR == WAIT_TIMEOUT)
+- return true;
++ if (getLockInfo(&pid, &hostname, &appname)) {
++ if (hostname == QString::fromLocal8Bit(localHostName())) {
++ HANDLE procHandle = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
++ if (!procHandle)
++ return true;
++ // We got a handle but check if process is still alive
++ DWORD dwR = ::WaitForSingleObject(procHandle, 0);
++ ::CloseHandle(procHandle);
++ if (dwR == WAIT_TIMEOUT)
++ return true;
++ }
+ }
+ #endif // !Q_OS_WINRT
+ const qint64 age = QFileInfo(fileName).lastModified().msecsTo(QDateTime::currentDateTime());
+diff --git a/qtbase/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/qtbase/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+index 77bef94..12bea67 100644
+--- a/qtbase/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
++++ b/qtbase/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+@@ -58,6 +58,7 @@ private slots:
+ void staleLongLockFromBusyProcess();
+ void staleLockRace();
+ void noPermissions();
++ void corruptedLockFile();
+
+ public:
+ QString m_helperApp;
+@@ -415,5 +416,21 @@ void tst_QLockFile::noPermissions()
+ QCOMPARE(int(lockFile.error()), int(QLockFile::PermissionError));
+ }
+
++void tst_QLockFile::corruptedLockFile()
++{
++ const QString fileName = dir.path() + "/corruptedLockFile";
++
++ {
++ // Create a empty file. Typically the result of a computer crash or hard disk full.
++ QFile file(fileName);
++ QVERIFY(file.open(QFile::WriteOnly));
++ }
++
++ QLockFile secondLock(fileName);
++ secondLock.setStaleLockTime(100);
++ QVERIFY(secondLock.tryLock(10000));
++ QCOMPARE(int(secondLock.error()), int(QLockFile::NoError));
++}
++
+ QTEST_MAIN(tst_QLockFile)
+ #include "tst_qlockfile.moc"
+--
+cgit v0.11.0
+