[SCM] qtbase packaging branch, ubuntu, updated. ubuntu/5.6.1+dfsg-3ubuntu5-6-gd914986
Timo Jyrinki
timo at moszumanska.debian.org
Wed Sep 28 18:14:55 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/qt/qtbase.git;a=commitdiff;h=05953c5
The following commit has been merged in the ubuntu branch:
commit 05953c5301188949894613f1c966aecfeae0f915
Author: Timo Jyrinki <timo.jyrinki at canonical.com>
Date: Wed Sep 28 18:13:10 2016 +0000
debian/patches/Fix-some-QtDBus-crashes-during-application-destructi.patch debian/patches/Merge-the-QDBusMetaType-s-custom-information-to-QDBu.patch debian/patches/Make-the-bearer-QFactoryLoader-a-member-variable-not.patch:
* debian/patches/Fix-some-QtDBus-crashes-during-application-destructi.patch
debian/patches/Merge-the-QDBusMetaType-s-custom-information-to-QDBu.patch
debian/patches/Make-the-bearer-QFactoryLoader-a-member-variable-not.patch:
- More D-Bus fixes (LP: #1618590)
---
debian/changelog | 7 +
...DBus-crashes-during-application-destructi.patch | 121 ++++++
...arer-QFactoryLoader-a-member-variable-not.patch | 90 +++++
...DBusMetaType-s-custom-information-to-QDBu.patch | 429 +++++++++++++++++++++
debian/patches/series | 3 +
5 files changed, 650 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index bcb408b..5efa1f1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,17 @@
qtbase-opensource-src (5.6.1+dfsg-3ubuntu6) UNRELEASED; urgency=medium
+ [ Dmitry Shachnev ]
* Mark allow_native_menubar.diff as applied upstream.
* debian/patches/dbustray_cleanup_notifier.diff:
- Fix a bug in QSystemTrayIcon code where the notifier was not cleaned
up and the callback was called multiple times.
+ [ Timo Jyrinki ]
+ * debian/patches/Fix-some-QtDBus-crashes-during-application-destructi.patch
+ debian/patches/Merge-the-QDBusMetaType-s-custom-information-to-QDBu.patch
+ debian/patches/Make-the-bearer-QFactoryLoader-a-member-variable-not.patch:
+ - More D-Bus fixes (LP: #1618590)
+
-- Dmitry Shachnev <mitya57 at ubuntu.com> Tue, 27 Sep 2016 14:19:18 +0300
qtbase-opensource-src (5.6.1+dfsg-3ubuntu5~1) yakkety; urgency=medium
diff --git a/debian/patches/Fix-some-QtDBus-crashes-during-application-destructi.patch b/debian/patches/Fix-some-QtDBus-crashes-during-application-destructi.patch
new file mode 100644
index 0000000..56a4b66
--- /dev/null
+++ b/debian/patches/Fix-some-QtDBus-crashes-during-application-destructi.patch
@@ -0,0 +1,121 @@
+From d060b7aa5fc64902ea89416e58b57d6a90f5aea6 Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira at intel.com>
+Date: Tue, 31 May 2016 17:33:03 -0300
+Subject: [PATCH] Fix some QtDBus crashes during application destruction
+
+It's possible that some code executes after QDBusConnectionManager is
+destroyed and still tries to access QtDBus. Protect against such
+crashes.
+
+Change-Id: I87e17314d8b24ae983b1fffd1453c13fbd3cf48e
+---
+ src/dbus/qdbusconnection.cpp | 12 ++++++++----
+ src/dbus/qdbusintegrator.cpp | 3 +++
+ src/dbus/qdbusserver.cpp | 12 ++++++++++--
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
+index 4db6396..c1c4f05 100644
+--- a/src/dbus/qdbusconnection.cpp
++++ b/src/dbus/qdbusconnection.cpp
+@@ -429,7 +429,7 @@ void QDBusConnectionManager::createServer(const QString &address, void *server)
+ */
+ QDBusConnection::QDBusConnection(const QString &name)
+ {
+- if (name.isEmpty()) {
++ if (name.isEmpty() || _q_manager.isDestroyed()) {
+ d = 0;
+ } else {
+ QMutexLocker locker(&_q_manager()->mutex);
+@@ -494,7 +494,7 @@ QDBusConnection &QDBusConnection::operator=(const QDBusConnection &other)
+ */
+ QDBusConnection QDBusConnection::connectToBus(BusType type, const QString &name)
+ {
+- if (!qdbus_loadLibDBus()) {
++ if (_q_manager.isDestroyed() || !qdbus_loadLibDBus()) {
+ QDBusConnectionPrivate *d = 0;
+ return QDBusConnection(d);
+ }
+@@ -508,7 +508,7 @@ QDBusConnection QDBusConnection::connectToBus(BusType type, const QString &name)
+ QDBusConnection QDBusConnection::connectToBus(const QString &address,
+ const QString &name)
+ {
+- if (!qdbus_loadLibDBus()) {
++ if (_q_manager.isDestroyed() || !qdbus_loadLibDBus()) {
+ QDBusConnectionPrivate *d = 0;
+ return QDBusConnection(d);
+ }
+@@ -523,7 +523,7 @@ QDBusConnection QDBusConnection::connectToBus(const QString &address,
+ QDBusConnection QDBusConnection::connectToPeer(const QString &address,
+ const QString &name)
+ {
+- if (!qdbus_loadLibDBus()) {
++ if (_q_manager.isDestroyed() || !qdbus_loadLibDBus()) {
+ QDBusConnectionPrivate *d = 0;
+ return QDBusConnection(d);
+ }
+@@ -1178,6 +1178,8 @@ bool QDBusConnection::unregisterService(const QString &serviceName)
+ */
+ QDBusConnection QDBusConnection::sessionBus()
+ {
++ if (_q_manager.isDestroyed())
++ return QDBusConnection(Q_NULLPTR);
+ return QDBusConnection(_q_manager()->busConnection(SessionBus));
+ }
+
+@@ -1190,6 +1192,8 @@ QDBusConnection QDBusConnection::sessionBus()
+ */
+ QDBusConnection QDBusConnection::systemBus()
+ {
++ if (_q_manager.isDestroyed())
++ return QDBusConnection(Q_NULLPTR);
+ return QDBusConnection(_q_manager()->busConnection(SystemBus));
+ }
+
+diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
+index 37d2ae1..9ea30d1 100644
+--- a/src/dbus/qdbusintegrator.cpp
++++ b/src/dbus/qdbusintegrator.cpp
+@@ -293,6 +293,9 @@ static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, v
+ Q_ASSERT(connection);
+ Q_ASSERT(data);
+
++ if (!QDBusConnectionManager::instance())
++ return;
++
+ // keep the connection alive
+ q_dbus_connection_ref(connection);
+ QDBusConnectionPrivate *serverConnection = static_cast<QDBusConnectionPrivate *>(data);
+diff --git a/src/dbus/qdbusserver.cpp b/src/dbus/qdbusserver.cpp
+index babb270..ecb7d4f 100644
+--- a/src/dbus/qdbusserver.cpp
++++ b/src/dbus/qdbusserver.cpp
+@@ -62,7 +62,11 @@ QDBusServer::QDBusServer(const QString &address, QObject *parent)
+ if (!qdbus_loadLibDBus())
+ return;
+
+- emit QDBusConnectionManager::instance()->serverRequested(address, this);
++ QDBusConnectionManager *instance = QDBusConnectionManager::instance();
++ if (!instance)
++ return;
++
++ emit instance->serverRequested(address, this);
+ QObject::connect(d, SIGNAL(newServerConnection(QDBusConnectionPrivate*)),
+ this, SLOT(_q_newConnection(QDBusConnectionPrivate*)), Qt::QueuedConnection);
+ }
+@@ -87,7 +91,11 @@ QDBusServer::QDBusServer(QObject *parent)
+ return;
+ }
+
+- emit QDBusConnectionManager::instance()->serverRequested(address, this);
++ QDBusConnectionManager *instance = QDBusConnectionManager::instance();
++ if (!instance)
++ return;
++
++ emit instance->serverRequested(address, this);
+ QObject::connect(d, SIGNAL(newServerConnection(QDBusConnectionPrivate*)),
+ this, SLOT(_q_newConnection(QDBusConnectionPrivate*)), Qt::QueuedConnection);
+ }
+--
+2.9.3
+
diff --git a/debian/patches/Make-the-bearer-QFactoryLoader-a-member-variable-not.patch b/debian/patches/Make-the-bearer-QFactoryLoader-a-member-variable-not.patch
new file mode 100644
index 0000000..bc4bad2
--- /dev/null
+++ b/debian/patches/Make-the-bearer-QFactoryLoader-a-member-variable-not.patch
@@ -0,0 +1,90 @@
+From b3b8b1a4b4623b344f3e50644d4b662a572ec139 Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira at intel.com>
+Date: Tue, 27 Sep 2016 16:52:55 -0700
+Subject: [PATCH] Make the bearer QFactoryLoader a member variable, not a
+ static
+
+Because it was a Q_GLOBAL_STATIC, the QFactoryLoader was getting
+destroyed out-of-sync with the bearer thread stopping. Under normal
+conditions, the thread stopped first (~QApplication / ~QCoreApplication
+via qAddPostRoutine), and the static got destroyed when the process
+exited. However, if QApplication leaked or if the destruction order is
+wonky (as seen in PyQt5), the thread could still be running when the
+plugins were already unloaded.
+
+With the loader a member variable, it gets destroyed when the thread
+stops.
+
+Note: in Qt 5.7, QFactoryLoader no longer unloads the plugins (since
+commit 494376f980e96339b6f1eff7c41336ca4d853065), so this crash cannot
+happen in that version. This commit also revises the fix from commit
+6be65702f8922084c1b8da2ed04b2729340f0a6b that went into 5.7.0.
+
+[ChangeLog][QtNetwork][Bearer management] Fixed a bug that could cause a
+crash on application exit, depending on the order of destruction of the
+QCoreApplication object and the QtDBus manager thread.
+
+Task-number: QTBUG-56228
+Task-number: QTBUG-52988
+Change-Id: I33dc971f005a4848bb8ffffd147853376f82de2a
+---
+ src/network/bearer/qnetworkconfigmanager_p.cpp | 8 ++++----
+ src/network/bearer/qnetworkconfigmanager_p.h | 2 ++
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
+index ccda9dd..177e8b6 100644
+--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
++++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
+@@ -34,8 +34,6 @@
+ #include "qnetworkconfigmanager_p.h"
+ #include "qbearerplugin_p.h"
+
+-#include <QtCore/private/qfactoryloader_p.h>
+-
+ #include <QtCore/qdebug.h>
+ #include <QtCore/qtimer.h>
+ #include <QtCore/qstringlist.h>
+@@ -57,7 +55,9 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
+ #endif
+
+ QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate()
+- : QObject(), pollTimer(0), mutex(QMutex::Recursive), forcedPolling(0), firstUpdate(true)
++ : QObject(), pollTimer(0), mutex(QMutex::Recursive),
++ loader(QBearerEngineFactoryInterface_iid, QLatin1String("/bearer")),
++ forcedPolling(0), firstUpdate(true)
+ {
+ qRegisterMetaType<QNetworkConfiguration>();
+ qRegisterMetaType<QNetworkConfigurationPrivatePointer>();
+@@ -382,7 +382,7 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
+ bool envOK = false;
+ const int skipGeneric = qgetenv("QT_EXCLUDE_GENERIC_BEARER").toInt(&envOK);
+ QBearerEngine *generic = 0;
+- QFactoryLoader *l = loader();
++ QFactoryLoader *l = &loader;
+ const PluginKeyMap keyMap = l->keyMap();
+ const PluginKeyMapConstIterator cend = keyMap.constEnd();
+ QStringList addedEngines;
+diff --git a/src/network/bearer/qnetworkconfigmanager_p.h b/src/network/bearer/qnetworkconfigmanager_p.h
+index 73407d3..5fd6143 100644
+--- a/src/network/bearer/qnetworkconfigmanager_p.h
++++ b/src/network/bearer/qnetworkconfigmanager_p.h
+@@ -48,6 +48,7 @@
+ #include "qnetworkconfigmanager.h"
+ #include "qnetworkconfiguration_p.h"
+
++#include <QtCore/private/qfactoryloader_p.h>
+ #include <QtCore/qmutex.h>
+ #include <QtCore/qset.h>
+
+@@ -111,6 +112,7 @@ private:
+ private:
+ mutable QMutex mutex;
+
++ QFactoryLoader loader;
+ QList<QBearerEngine *> sessionEngines;
+
+ QSet<QString> onlineConfigurations;
+--
+2.7.4
+
diff --git a/debian/patches/Merge-the-QDBusMetaType-s-custom-information-to-QDBu.patch b/debian/patches/Merge-the-QDBusMetaType-s-custom-information-to-QDBu.patch
new file mode 100644
index 0000000..f84c2ef
--- /dev/null
+++ b/debian/patches/Merge-the-QDBusMetaType-s-custom-information-to-QDBu.patch
@@ -0,0 +1,429 @@
+From 93eb0169cbec0de47a66c1b78b734863fb921326 Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira at intel.com>
+Date: Thu, 28 Apr 2016 15:00:58 -0700
+Subject: [PATCH] Merge the QDBusMetaType's custom information to
+ QDBusConnectionManager
+
+This allows us to get rid of two Q_GLOBAL_STATIC in QtDBus, which means
+fewer opportunities for screwing up the order of destruction. And since
+QDBusConnectionManager now ensures that the types are initialized, we
+don't need to re-initialize them everywhere.
+
+The Q_GLOBAL_STATIC for QDBusConnectionManager ensures the proper
+thread-safe locking, so we don't need to lock for every type that we're
+trying to register. This should make things faster.
+
+But as a side-effect, trying to register a D-Bus metatype will cause the
+QDBusConnectionManager thread to start too.
+
+Change-Id: Ifea6e497f11a461db432ffff1449a4e535234485
+---
+ src/dbus/qdbusconnection.cpp | 1 +
+ src/dbus/qdbusconnectionmanager_p.h | 3 +-
+ src/dbus/qdbusintegrator.cpp | 1 -
+ src/dbus/qdbusmetatype.cpp | 185 +++++++++++++++++++-----------------
+ src/dbus/qdbusmetatype_p.h | 27 +++++-
+ src/dbus/qdbusmisc.cpp | 3 +-
+ 6 files changed, 127 insertions(+), 93 deletions(-)
+
+diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
+index 34b3da7..4db6396 100644
+--- a/src/dbus/qdbusconnection.cpp
++++ b/src/dbus/qdbusconnection.cpp
+@@ -193,6 +193,7 @@ void QDBusConnectionManager::run()
+ }
+ }
+ connectionHash.clear();
++ customTypes.clear();
+
+ // allow deletion from any thread without warning
+ moveToThread(Q_NULLPTR);
+diff --git a/src/dbus/qdbusconnectionmanager_p.h b/src/dbus/qdbusconnectionmanager_p.h
+index c0ab48e..97ecc74 100644
+--- a/src/dbus/qdbusconnectionmanager_p.h
++++ b/src/dbus/qdbusconnectionmanager_p.h
+@@ -48,13 +48,14 @@
+ #define QDBUSCONNECTIONMANAGER_P_H
+
+ #include "qdbusconnection_p.h"
++#include "qdbusmetatype_p.h"
+ #include "private/qthread_p.h"
+
+ #ifndef QT_NO_DBUS
+
+ QT_BEGIN_NAMESPACE
+
+-class QDBusConnectionManager : public QDaemonThread
++class QDBusConnectionManager : public QDaemonThread, public QDBusMetaTypeId
+ {
+ Q_OBJECT
+ struct ConnectionRequestData;
+diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
+index 3be775d..37d2ae1 100644
+--- a/src/dbus/qdbusintegrator.cpp
++++ b/src/dbus/qdbusintegrator.cpp
+@@ -1019,7 +1019,6 @@ QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p)
+ qdbusThreadDebug = qdbusDefaultThreadDebug;
+ #endif
+
+- QDBusMetaTypeId::init();
+ connect(this, &QDBusConnectionPrivate::dispatchStatusChanged,
+ this, &QDBusConnectionPrivate::doDispatch, Qt::QueuedConnection);
+ connect(this, &QDBusConnectionPrivate::spyHooksFinished,
+diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp
+index 2aaf0e2..ce0d0c8 100644
+--- a/src/dbus/qdbusmetatype.cpp
++++ b/src/dbus/qdbusmetatype.cpp
+@@ -1,6 +1,7 @@
+ /****************************************************************************
+ **
+ ** Copyright (C) 2015 The Qt Company Ltd.
++** Copyright (C) 2016 Intel Corporation.
+ ** Contact: http://www.qt.io/licensing/
+ **
+ ** This file is part of the QtDBus module of the Qt Toolkit.
+@@ -33,19 +34,15 @@
+
+ #include "qdbusmetatype.h"
+ #include "qdbusmetatype_p.h"
+-
+-#include <string.h>
+ #include "qdbus_symbols_p.h"
+
+-#include <qbytearray.h>
+-#include <qglobal.h>
+-#include <qreadwritelock.h>
+-#include <qvector.h>
++#include <string.h>
+
+ #include "qdbusargument_p.h"
+ #include "qdbusutil_p.h"
+ #include "qdbusunixfiledescriptor.h"
+ #ifndef QT_BOOTSTRAPPED
++#include "qdbusconnectionmanager_p.h"
+ #include "qdbusmessage.h"
+ #endif
+
+@@ -58,82 +55,72 @@
+
+ QT_BEGIN_NAMESPACE
+
+-class QDBusCustomTypeInfo
+-{
+-public:
+- QDBusCustomTypeInfo() : signature(), marshall(0), demarshall(0)
+- { }
+-
+- // Suggestion:
+- // change 'signature' to char* and make QDBusCustomTypeInfo a Movable type
+- QByteArray signature;
+- QDBusMetaType::MarshallFunction marshall;
+- QDBusMetaType::DemarshallFunction demarshall;
+-};
++static void registerMarshallOperatorsNoLock(QVector<QDBusCustomTypeInfo> &ct, int id,
++ QDBusMetaType::MarshallFunction mf,
++ QDBusMetaType::DemarshallFunction df);
+
+ template<typename T>
+-inline static void registerHelper(T * = 0)
++inline static void registerHelper(QVector<QDBusCustomTypeInfo> &ct)
+ {
+ void (*mf)(QDBusArgument &, const T *) = qDBusMarshallHelper<T>;
+ void (*df)(const QDBusArgument &, T *) = qDBusDemarshallHelper<T>;
+- QDBusMetaType::registerMarshallOperators(qMetaTypeId<T>(),
++ registerMarshallOperatorsNoLock(ct, qMetaTypeId<T>(),
+ reinterpret_cast<QDBusMetaType::MarshallFunction>(mf),
+ reinterpret_cast<QDBusMetaType::DemarshallFunction>(df));
+ }
+
+-void QDBusMetaTypeId::init()
++QDBusMetaTypeId *QDBusMetaTypeId::instance()
+ {
+- static QBasicAtomicInt initialized = Q_BASIC_ATOMIC_INITIALIZER(false);
+-
+- // reentrancy is not a problem since everything else is locked on their own
+- // set the guard variable at the end
+- if (!initialized.load()) {
+- // register our types with Qt Core (calling qMetaTypeId<T>() does this implicitly)
+- (void)message();
+- (void)argument();
+- (void)variant();
+- (void)objectpath();
+- (void)signature();
+- (void)error();
+- (void)unixfd();
++#ifdef QT_BOOTSTRAPPED
++ static QDBusMetaTypeId self;
++ return &self;
++#else
++ return QDBusConnectionManager::instance();
++#endif
++}
++
++QDBusMetaTypeId::QDBusMetaTypeId()
++{
++ // register our types with Qt Core (calling qMetaTypeId<T>() does this implicitly)
++ (void)message();
++ (void)argument();
++ (void)variant();
++ (void)objectpath();
++ (void)signature();
++ (void)error();
++ (void)unixfd();
+
+ #ifndef QDBUS_NO_SPECIALTYPES
+- // and register Qt Core's with us
+- registerHelper<QDate>();
+- registerHelper<QTime>();
+- registerHelper<QDateTime>();
+- registerHelper<QRect>();
+- registerHelper<QRectF>();
+- registerHelper<QSize>();
+- registerHelper<QSizeF>();
+- registerHelper<QPoint>();
+- registerHelper<QPointF>();
+- registerHelper<QLine>();
+- registerHelper<QLineF>();
+- registerHelper<QVariantList>();
+- registerHelper<QVariantMap>();
+- registerHelper<QVariantHash>();
+-
+- qDBusRegisterMetaType<QList<bool> >();
+- qDBusRegisterMetaType<QList<short> >();
+- qDBusRegisterMetaType<QList<ushort> >();
+- qDBusRegisterMetaType<QList<int> >();
+- qDBusRegisterMetaType<QList<uint> >();
+- qDBusRegisterMetaType<QList<qlonglong> >();
+- qDBusRegisterMetaType<QList<qulonglong> >();
+- qDBusRegisterMetaType<QList<double> >();
+- qDBusRegisterMetaType<QList<QDBusObjectPath> >();
+- qDBusRegisterMetaType<QList<QDBusSignature> >();
+- qDBusRegisterMetaType<QList<QDBusUnixFileDescriptor> >();
++ // and register Qt Core's with us
++ registerHelper<QDate>(customTypes);
++ registerHelper<QTime>(customTypes);
++ registerHelper<QDateTime>(customTypes);
++ registerHelper<QRect>(customTypes);
++ registerHelper<QRectF>(customTypes);
++ registerHelper<QSize>(customTypes);
++ registerHelper<QSizeF>(customTypes);
++ registerHelper<QPoint>(customTypes);
++ registerHelper<QPointF>(customTypes);
++ registerHelper<QLine>(customTypes);
++ registerHelper<QLineF>(customTypes);
++ registerHelper<QVariantList>(customTypes);
++ registerHelper<QVariantMap>(customTypes);
++ registerHelper<QVariantHash>(customTypes);
++
++ registerHelper<QList<bool> >(customTypes);
++ registerHelper<QList<short> >(customTypes);
++ registerHelper<QList<ushort> >(customTypes);
++ registerHelper<QList<int> >(customTypes);
++ registerHelper<QList<uint> >(customTypes);
++ registerHelper<QList<qlonglong> >(customTypes);
++ registerHelper<QList<qulonglong> >(customTypes);
++ registerHelper<QList<double> >(customTypes);
++ registerHelper<QList<QDBusObjectPath> >(customTypes);
++ registerHelper<QList<QDBusSignature> >(customTypes);
++ registerHelper<QList<QDBusUnixFileDescriptor> >(customTypes);
+ #endif
+-
+- initialized.store(true);
+- }
+ }
+
+-Q_GLOBAL_STATIC(QVector<QDBusCustomTypeInfo>, customTypes)
+-Q_GLOBAL_STATIC(QReadWriteLock, customTypesLock)
+-
+ /*!
+
--
qtbase packaging
More information about the pkg-kde-commits
mailing list