Review Request 126252: Workaround a probable QtDBus bug when receiving massive amount of scrollback from MUC

Daniel Vrátil dvratil at kde.org
Sat Dec 5 19:43:20 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126252/
-----------------------------------------------------------

Review request for Telepathy.


Repository: ktp-text-ui


Description
-------

When joining a MUC room on a server that automatically sends a scrollback of all messages on the channel, the ktp-text-ui gets stuck eventually due to timeouts and a bug somewhere in QtDBus (see the backtrace below). The problem seems to be that the amount of DBus traffic coming from Telepathy combined with the amount of traffic going out from our plugins (through KIO) just causes Qt to never acknowledge that the reply from DBus has arrived. I tried to debug it a bit more, but did not get to anything useful, only found a workaround...

This patch adds a very dirty workaround to ensure that incoming and outgoing messages are processed by Qt more often thus preventing the bug above and allowing me to join the big-traffic MUC channel from KTp (otherwise I have to use Kopete) **big sad eyes**


```
#0  0x00007fc7f6498b10 in pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007fc7fbdfc29b in QWaitCondition::wait(QMutex*, unsigned long) (time=18446744073709551615, this=0x1d957c0) at thread/qwaitcondition_unix.cpp:136
#2  0x00007fc7fbdfc29b in QWaitCondition::wait(QMutex*, unsigned long) (this=this at entry=0x1d350e0, mutex=mutex at entry=0x1d350d8, time=time at entry=18446744073709551615)
    at thread/qwaitcondition_unix.cpp:208
#3  0x00007fc7fd47e494 in QDBusPendingCallPrivate::waitForFinished() (this=this at entry=0x1d350a0) at qdbuspendingcall.cpp:234
#4  0x00007fc7fd43abd1 in QDBusConnectionPrivate::sendWithReply(QDBusMessage const&, int, int) (this=0x7fc7e0003480, message=..., sendMode=1, timeout=-1)
    at qdbusintegrator.cpp:1901
#5  0x00007fc7fd4290eb in QDBusConnection::call(QDBusMessage const&, QDBus::CallMode, int) const (this=this at entry=0x7fc7e0007ee0, message=..., mode=mode at entry=QDBus::Block, timeout=<optimized out>) at qdbusconnection.cpp:641
#6  0x00007fc7fd445182 in QDBusAbstractInterface::callWithArgumentList(QDBus::CallMode, QString const&, QList<QVariant> const&) (this=<optimized out>, mode=QDBus::Block, mode at entry=QDBus::AutoDetect, method=..., args=...) at qdbusabstractinterface.cpp:488
#7  0x00007fc7fd445c7d in QDBusAbstractInterface::internalConstCall(QDBus::CallMode, QString const&, QList<QVariant> const&) const (this=<optimized out>, mode=mode at entry=QDBus::AutoDetect, method=..., args=...) at qdbusabstractinterface.cpp:843
#8  0x00007fc7fd42db26 in QDBusConnectionInterface::isServiceRegistered(QString const&) const (this=<optimized out>, serviceName=...)
    at qdbusconnectioninterface.cpp:201
#9  0x00007fc7f07c3cf5 in KDEInitInterface::ensureKdeinitRunning() () at /home/dvratil/devel/KDE/frameworks/kdbusaddons/src/kdeinitinterface.cpp:35
#10 0x00007fc8007cb3ac in klauncher() () at /home/dvratil/devel/KDE/frameworks/kio/src/core/slave.cpp:66
#11 0x00007fc8007ccb32 in KIO::Slave::createSlave(QString const&, QUrl const&, int&, QString&) (protocol=..., url=..., error=@0x7ffdfb47692c: 0, error_text=...)
    at /home/dvratil/devel/KDE/frameworks/kio/src/core/slave.cpp:505
#12 0x00007fc8007ef76f in KIO::ProtoQueue::createSlave(QString const&, KIO::SimpleJob*, QUrl const&) (this=0x11ef6f0, protocol=..., job=0x1c57700, url=...)
    at /home/dvratil/devel/KDE/frameworks/kio/src/core/scheduler.cpp:529
#13 0x00007fc8007efcd7 in KIO::ProtoQueue::startAJob() (this=0x11ef6f0) at /home/dvratil/devel/KDE/frameworks/kio/src/core/scheduler.cpp:616
#14 0x00007fc8007f31d9 in KIO::ProtoQueue::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x11ef6f0, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7ffdfb476b00) at /home/dvratil/devel/KDE/build/frameworks/kio/src/core/moc_scheduler_p.cpp:250
#15 0x00007fc7fbff9c70 in QMetaObject::activate(QObject*, int, int, void**) (sender=sender at entry=0x11ef748, signalOffset=<optimized out>, local_signal_index=local_signal_index at entry=0, argv=argv at entry=0x0) at kernel/qobject.cpp:3730
#16 0x00007fc7fbffa547 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender at entry=0x11ef748, m=m at entry=0x7fc7fc412e40 <QTimer::staticMetaObject>, local_signal_index=local_signal_index at entry=0, argv=argv at entry=0x0) at kernel/qobject.cpp:3595
#17 0x00007fc7fc075b80 in QTimer::timeout(QTimer::QPrivateSignal) (this=this at entry=0x11ef748) at .moc/moc_qtimer.cpp:197
#18 0x00007fc7fc006548 in QTimer::timerEvent(QTimerEvent*) (this=0x11ef748, e=<optimized out>) at kernel/qtimer.cpp:247
#19 0x00007fc7fbffaa63 in QObject::event(QEvent*) (this=0x11ef748, e=<optimized out>) at kernel/qobject.cpp:1278
#20 0x00007fc7fcceff5c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x11ef748, e=0x7ffdfb476e20)
    at kernel/qapplication.cpp:3717
#21 0x00007fc7fccf5176 in QApplication::notify(QObject*, QEvent*) (this=0xc91330, receiver=0x11ef748, e=0x7ffdfb476e20) at kernel/qapplication.cpp:3498
#22 0x00007fc7fbfcd518 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x11ef748, event=event at entry=0x7ffdfb476e20)
    at kernel/qcoreapplication.cpp:1002
#23 0x00007fc7fc02168e in QTimerInfoList::activateTimers() (event=0x7ffdfb476e20, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:227
#24 0x00007fc7fc02168e in QTimerInfoList::activateTimers() (this=0xce5360) at kernel/qtimerinfo_unix.cpp:637
#25 0x00007fc7fc021bc1 in timerSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:176
#26 0x00007fc7f732ae3a in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#27 0x00007fc7f732b1d0 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#28 0x00007fc7f732b27c in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#29 0x00007fc7fc02279f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0xcf54b0, flags=...)
    at kernel/qeventdispatcher_glib.cpp:417
#30 0x00007fc7fbfcb0aa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this at entry=0x7ffdfb477070, flags=..., flags at entry=...)
    at kernel/qeventloop.cpp:204
#31 0x00007fc7fbfd395c in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1272
#32 0x00007fc7fc50e37c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1571
#33 0x00007fc7fcced125 in QApplication::exec() () at kernel/qapplication.cpp:2976
#34 0x0000000000418c63 in main(int, char**) (argc=3, argv=0x7ffdfb4772e8) at /home/dvratil/devel/KDE/kde/kdenetwork/ktp-text-ui/app/main.cpp:71
```


Diffs
-----

  lib/chat-widget.cpp e26b57c 

Diff: https://git.reviewboard.kde.org/r/126252/diff/


Testing
-------


Thanks,

Daniel Vrátil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20151205/020a6b80/attachment-0001.html>


More information about the KDE-Telepathy mailing list