Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.4.1
-
None
-
Ubuntu 14.04
Qt5.4.1
Description
I am running across an intermittent deadlock in initialization of my Qt program, while it's relatively idle and in the event loop.
I confirmed this was a futex_wait by using strace, and I always see an entry like this for the main thread:
[pid 1812] futex(0x7f28f400aecc, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...>
I found out that I could add a Qt event filter, and therefore log events as they are processed from the main thread. Here's a snippet for that:
bool ActivityEventFilter::eventFilter(QObject *obj, QEvent *ev){ VLOG(5) << "inspecting event " << obj << " name " << obj->objectName().toStdString() << " class " << obj->metaObject()->className() << " eventType " << ev->type(); if (VLOG_IS_ON(5)) { if (ev->type() == QEvent::MetaCall) { if (QString(obj->metaObject()->className()).contains("QDBusConnectionPrivate") { VLOG(5) << "Dumping object data"; obj->dumpObjectInfo(); obj->dumpObjectTree(); } } } ... }
And examining my logging, the freeze always is preceded by these lines:
I0614 17:18:27.928889 1812 ActivityEventFilter.cpp:19] inspecting event 0x7fde200144c0 name class QDBusConnectionPrivate eventType 43 I0614 17:18:27.928901 1812 ActivityEventFilter.cpp:28] Dumping object data
There is no output from the object info or from the object tree. I am flushing the logs
I am not consciously using DBus anywhere in my application, so I'm looking to find a way to track down who is calling it to see if it can be prevented, but without the objectInfo, I don't know where to start.
I found two Qt bug reports:
https://bugreports.qt.io/browse/QTBUG-42189
https://bugreports.qt.io/browse/QTBUG-51648
The first looks like the same type of problem, but it appears all the resolutions went into Qt 5.4.0. (I'm using Qt 5.4.1)
The second looks like a bit different behavior to me.