Em seg 30 jun 2014, às 14:14:10, Milian Wolff escreveu:
> On Monday 30 June 2014 00:05:10 šumski wrote:
> > On Thursday 26 of June 2014 12:14:49 Milian Wolff wrote:
> > > Hey,
> > > 
> > > did you run it through valgrind?
> > 
> > Here's what valgrind says:
> Sounds like a bug in Qt to me, I have to say. Looking at the code,
> QDBusConnectionPrivate::objectDestroyed looks pretty fragile, I mean it does
> this at the end:
> 
> obj->disconnect(this);
> 
> But from the code in QDBusConnectionPrivate::disconnectSignal nothing jumps
> out as dangerous directly. The fact, that valgrind is getting confused in
> the stack trace is not helping either ;-) Could you maybe try to compile
> qtbase in debug mode and reproduce the issue, such that we get a full
> stacktrace without optimizations etc.?
> 
> Anyways, maybe Thiago (CC'ed) can give us some insight on whats going on
> here.

This is happening in a global destructor during the use of a global static. My 
guess would be that the global static has already been destroyed, hence the 
issue.

Try this patch, which removes it. We have QStringLiteral nowadays.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>From eda5c8ede9fd35117146d13f1b55775c9007b672 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macie...@intel.com>
Date: Mon, 30 Jun 2014 08:31:22 -0700
Subject: [PATCH 1/1] Replace the const QString global static with a
 QStringLiteral

It was originally created to avoid allocating memory for the QString at
every turn, but we have QStringLiteral for that today. It has also
served a very good run by catching qatomic.h implementations that had
bad cv qualifications.

Change-Id: Id6d952b8cce363015ec2611d346b4cccedecf137
---
 src/dbus/qdbusintegrator.cpp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index d4079e8..bc28d50 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -76,15 +76,21 @@ QT_BEGIN_NAMESPACE
 static bool isDebugging;
 #define qDBusDebug              if (!::isDebugging); else qDebug
 
-Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS)))
+QString orgFreedesktopDBusString()
+{
+    return QStringLiteral(DBUS_SERVICE_DBUS);
+}
 
 static inline QString dbusServiceString()
-{ return *orgFreedesktopDBusString(); }
+{
+    return orgFreedesktopDBusString();
+}
+
 static inline QString dbusInterfaceString()
 {
     // it's the same string, but just be sure
-    Q_ASSERT(*orgFreedesktopDBusString() == QLatin1String(DBUS_INTERFACE_DBUS));
-    return *orgFreedesktopDBusString();
+    Q_ASSERT(orgFreedesktopDBusString() == QLatin1String(DBUS_INTERFACE_DBUS));
+    return orgFreedesktopDBusString();
 }
 
 static inline QDebug operator<<(QDebug dbg, const QThread *th)
-- 
1.8.4.5

_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel

Reply via email to