<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/126252/">https://git.reviewboard.kde.org/r/126252/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
<div>Review request for Telepathy.</div>
<div>By Daniel Vrátil.</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
ktp-text-ui
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">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...</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">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) *<em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">big sad eyes</em>*</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #BC7A00">#0 0x00007fc7f6498b10 in pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185</span>
<span style="color: #BC7A00">#1 0x00007fc7fbdfc29b in QWaitCondition::wait(QMutex*, unsigned long) (time=18446744073709551615, this=0x1d957c0) at thread/qwaitcondition_unix.cpp:136</span>
<span style="color: #BC7A00">#2 0x00007fc7fbdfc29b in QWaitCondition::wait(QMutex*, unsigned long) (this=this@entry=0x1d350e0, mutex=mutex@entry=0x1d350d8, time=time@entry=18446744073709551615)</span>
at <span style="color: #008000; font-weight: bold">thread</span><span style="color: #666666">/</span>qwaitcondition_unix.<span style="color: #A0A000">cpp</span>:<span style="color: #666666">208</span>
<span style="color: #BC7A00">#3 0x00007fc7fd47e494 in QDBusPendingCallPrivate::waitForFinished() (this=this@entry=0x1d350a0) at qdbuspendingcall.cpp:234</span>
<span style="color: #BC7A00">#4 0x00007fc7fd43abd1 in QDBusConnectionPrivate::sendWithReply(QDBusMessage const&, int, int) (this=0x7fc7e0003480, message=..., sendMode=1, timeout=-1)</span>
at qdbusintegrator.<span style="color: #A0A000">cpp</span>:<span style="color: #666666">1901</span>
<span style="color: #BC7A00">#5 0x00007fc7fd4290eb in QDBusConnection::call(QDBusMessage const&, QDBus::CallMode, int) const (this=this@entry=0x7fc7e0007ee0, message=..., mode=mode@entry=QDBus::Block, timeout=<optimized out>) at qdbusconnection.cpp:641</span>
<span style="color: #BC7A00">#6 0x00007fc7fd445182 in QDBusAbstractInterface::callWithArgumentList(QDBus::CallMode, QString const&, QList<QVariant> const&) (this=<optimized out>, mode=QDBus::Block, mode@entry=QDBus::AutoDetect, method=..., args=...) at qdbusabstractinterface.cpp:488</span>
<span style="color: #BC7A00">#7 0x00007fc7fd445c7d in QDBusAbstractInterface::internalConstCall(QDBus::CallMode, QString const&, QList<QVariant> const&) const (this=<optimized out>, mode=mode@entry=QDBus::AutoDetect, method=..., args=...) at qdbusabstractinterface.cpp:843</span>
<span style="color: #BC7A00">#8 0x00007fc7fd42db26 in QDBusConnectionInterface::isServiceRegistered(QString const&) const (this=<optimized out>, serviceName=...)</span>
at qdbusconnectioninterface.<span style="color: #A0A000">cpp</span>:<span style="color: #666666">201</span>
<span style="color: #BC7A00">#9 0x00007fc7f07c3cf5 in KDEInitInterface::ensureKdeinitRunning() () at /home/dvratil/devel/KDE/frameworks/kdbusaddons/src/kdeinitinterface.cpp:35</span>
<span style="color: #BC7A00">#10 0x00007fc8007cb3ac in klauncher() () at /home/dvratil/devel/KDE/frameworks/kio/src/core/slave.cpp:66</span>
<span style="color: #BC7A00">#11 0x00007fc8007ccb32 in KIO::Slave::createSlave(QString const&, QUrl const&, int&, QString&) (protocol=..., url=..., error=@0x7ffdfb47692c: 0, error_text=...)</span>
at <span style="color: #666666">/</span>home<span style="color: #666666">/</span>dvratil<span style="color: #666666">/</span>devel<span style="color: #666666">/</span>KDE<span style="color: #666666">/</span>frameworks<span style="color: #666666">/</span>kio<span style="color: #666666">/</span>src<span style="color: #666666">/</span>core<span style="color: #666666">/</span>slave.<span style="color: #A0A000">cpp</span>:<span style="color: #666666">505</span>
<span style="color: #BC7A00">#12 0x00007fc8007ef76f in KIO::ProtoQueue::createSlave(QString const&, KIO::SimpleJob*, QUrl const&) (this=0x11ef6f0, protocol=..., job=0x1c57700, url=...)</span>
at <span style="color: #666666">/</span>home<span style="color: #666666">/</span>dvratil<span style="color: #666666">/</span>devel<span style="color: #666666">/</span>KDE<span style="color: #666666">/</span>frameworks<span style="color: #666666">/</span>kio<span style="color: #666666">/</span>src<span style="color: #666666">/</span>core<span style="color: #666666">/</span>scheduler.<span style="color: #A0A000">cpp</span>:<span style="color: #666666">529</span>
<span style="color: #BC7A00">#13 0x00007fc8007efcd7 in KIO::ProtoQueue::startAJob() (this=0x11ef6f0) at /home/dvratil/devel/KDE/frameworks/kio/src/core/scheduler.cpp:616</span>
<span style="color: #BC7A00">#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</span>
<span style="color: #BC7A00">#15 0x00007fc7fbff9c70 in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0x11ef748, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3730</span>
<span style="color: #BC7A00">#16 0x00007fc7fbffa547 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x11ef748, m=m@entry=0x7fc7fc412e40 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3595</span>
<span style="color: #BC7A00">#17 0x00007fc7fc075b80 in QTimer::timeout(QTimer::QPrivateSignal) (this=this@entry=0x11ef748) at .moc/moc_qtimer.cpp:197</span>
<span style="color: #BC7A00">#18 0x00007fc7fc006548 in QTimer::timerEvent(QTimerEvent*) (this=0x11ef748, e=<optimized out>) at kernel/qtimer.cpp:247</span>
<span style="color: #BC7A00">#19 0x00007fc7fbffaa63 in QObject::event(QEvent*) (this=0x11ef748, e=<optimized out>) at kernel/qobject.cpp:1278</span>
<span style="color: #BC7A00">#20 0x00007fc7fcceff5c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x11ef748, e=0x7ffdfb476e20)</span>
at kernel<span style="color: #666666">/</span>qapplication.<span style="color: #A0A000">cpp</span>:<span style="color: #666666">3717</span>
<span style="color: #BC7A00">#21 0x00007fc7fccf5176 in QApplication::notify(QObject*, QEvent*) (this=0xc91330, receiver=0x11ef748, e=0x7ffdfb476e20) at kernel/qapplication.cpp:3498</span>
<span style="color: #BC7A00">#22 0x00007fc7fbfcd518 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x11ef748, event=event@entry=0x7ffdfb476e20)</span>
at kernel<span style="color: #666666">/</span>qcoreapplication.<span style="color: #A0A000">cpp</span>:<span style="color: #666666">1002</span>
<span style="color: #BC7A00">#23 0x00007fc7fc02168e in QTimerInfoList::activateTimers() (event=0x7ffdfb476e20, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:227</span>
<span style="color: #BC7A00">#24 0x00007fc7fc02168e in QTimerInfoList::activateTimers() (this=0xce5360) at kernel/qtimerinfo_unix.cpp:637</span>
<span style="color: #BC7A00">#25 0x00007fc7fc021bc1 in timerSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:176</span>
<span style="color: #BC7A00">#26 0x00007fc7f732ae3a in g_main_context_dispatch () at /lib64/libglib-2.0.so.0</span>
<span style="color: #BC7A00">#27 0x00007fc7f732b1d0 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0</span>
<span style="color: #BC7A00">#28 0x00007fc7f732b27c in g_main_context_iteration () at /lib64/libglib-2.0.so.0</span>
<span style="color: #BC7A00">#29 0x00007fc7fc02279f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0xcf54b0, flags=...)</span>
at kernel<span style="color: #666666">/</span>qeventdispatcher_glib.<span style="color: #A0A000">cpp</span>:<span style="color: #666666">417</span>
<span style="color: #BC7A00">#30 0x00007fc7fbfcb0aa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffdfb477070, flags=..., flags@entry=...)</span>
at kernel<span style="color: #666666">/</span>qeventloop.<span style="color: #A0A000">cpp</span>:<span style="color: #666666">204</span>
<span style="color: #BC7A00">#31 0x00007fc7fbfd395c in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1272</span>
<span style="color: #BC7A00">#32 0x00007fc7fc50e37c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1571</span>
<span style="color: #BC7A00">#33 0x00007fc7fcced125 in QApplication::exec() () at kernel/qapplication.cpp:2976</span>
<span style="color: #BC7A00">#34 0x0000000000418c63 in main(int, char**) (argc=3, argv=0x7ffdfb4772e8) at /home/dvratil/devel/KDE/kde/kdenetwork/ktp-text-ui/app/main.cpp:71</span>
</pre></div>
</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>lib/chat-widget.cpp <span style="color: grey">(e26b57c)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/126252/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>