Bug 329332

Summary: Very long loading application
Product: [Unmaintained] telepathy Reporter: K G <govik>
Component: text-uiAssignee: Telepathy Bugs <kde-telepathy-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: cfeck, gasinvein, goo, kde, mklapetek, thiago.bauermann
Priority: NOR    
Version: git-latest   
Target Milestone: Future   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Call stack during delay.

Description K G 2013-12-28 18:34:57 UTC
It takes a lot of time to load tex-ui window. 

Opening new conversation in new  tab or detaching tab works instantly. 

After closing window and opening new it loads very long again. 

Reproducible: Always

Steps to Reproduce:
1.Just open new chat from contact list
2.
3.
Actual Results:  
Windows appears after few seconds, it freezes for about 40 seconds and after that is operational.  

Expected Results:  
Window appear and ready after few seconds

After debugging i found it is caused by by QWebView.
It takes about 5 seconds to call 
 method setHtml(templateHtml); 
but signal finished is emitted after  40-50 seconds. 

During that time the main event loop of application is locked.
Comment 1 K G 2013-12-28 18:37:34 UTC
Created attachment 84310 [details]
Call stack during delay.

I guess it means that Webkit is checking network status by QNetworkConfigurationManager during that time.
Comment 2 David Edmundson 2014-02-18 15:37:00 UTC
Better backtrace from Shadeslayer

Thread 2 (Thread 0x7f18225c5700 (LWP 17755)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f1835a3c3bd in ?? () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#2  0x00007f1835a3c3f9 in ?? () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#3  0x00007f183992e182 in start_thread (arg=0x7f18225c5700) at pthread_create.c:312
#4  0x00007f183a5d2b2d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
 
Thread 1 (Thread 0x7f183e75a7c0 (LWP 17754)):
#0  0x00007f183a5c571d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f18338654b8 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#2  0x00007f18338643ff in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#3  0x00007f183384e9dc in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#4  0x00007f183384f389 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#5  0x00007f183384f94d in dbus_connection_send_with_reply_and_block () from /lib/x86_64-linux-gnu/libdbus-1.so.3
#6  0x00007f183b880890 in q_dbus_connection_send_with_reply_and_block (error=0x7fff1ff32a80, timeout_milliseconds=-1, message=0x25ca0d0, connection=<optimized out>)
    at qdbus_symbols_p.h:135
#7  QDBusConnectionPrivate::sendWithReply (this=this@entry=0x2230930, message=..., sendMode=sendMode@entry=1, timeout=timeout@entry=-1) at qdbusintegrator.cpp:1912
#8  0x00007f183b882622 in QDBusConnectionPrivate::findMetaObject (this=0x2230930, service=..., path=..., interface=..., error=...) at qdbusintegrator.cpp:2386
#9  0x00007f183b88dc0b in QDBusInterfacePrivate::QDBusInterfacePrivate (this=0x27d4690, serv=..., p=..., iface=..., con=...) at qdbusinterface.cpp:158
#10 0x00007f183b88dd35 in QDBusInterface::QDBusInterface (this=0x23ff910, service=..., path=..., interface=..., connection=..., parent=0x0) at qdbusinterface.cpp:220
#11 0x00007f183e1ba0c6 in KSystemTimeZonesPrivate::instance () at ../../kdecore/date/ksystemtimezone.cpp:304
#12 0x00007f183e1bb009 in KSystemTimeZones::local () at ../../kdecore/date/ksystemtimezone.cpp:201
#13 0x00007f183e1a0e3d in KDateTime::Spec::setType (this=0x7fff1ff32e80, type=<optimized out>, utcOffset=<optimized out>) at ../../kdecore/date/kdatetime.cpp:170
#14 0x00007f183e1abace in KDateTimeFormatter::formatDate (this=this@entry=0x7fff1ff32f00, fromDate=..., toFormat=..., calendar=calendar@entry=0x27be930, locale=0x2380330,
    digitSet=digitSet@entry=KLocale::ArabicDigits, formatStandard=formatStandard@entry=KLocale::KdeFormat) at ../../kdecore/date/kdatetimeformatter.cpp:59
#15 0x00007f183e18ee1f in KCalendarSystem::formatDate (this=this@entry=0x27be930, fromDate=..., toFormat=..., digitSet=KLocale::ArabicDigits,
    formatStandard=formatStandard@entry=KLocale::KdeFormat) at ../../kdecore/date/kcalendarsystem.cpp:2107
#16 0x00007f183e18ee6e in KCalendarSystem::formatDate (this=this@entry=0x27be930, fromDate=..., toFormat=..., standard=KLocale::KdeFormat)
    at ../../kdecore/date/kcalendarsystem.cpp:2095
#17 0x00007f183e18efdc in KCalendarSystem::formatDate (this=0x27be930, fromDate=..., toFormat=<optimized out>) at ../../kdecore/date/kcalendarsystem.cpp:2086
#18 0x00007f183e2830cf in KLocalePrivate::formatDate (this=<optimized out>, date=..., format=KLocale::LongDate) at ../../kdecore/localization/klocale_kde.cpp:1859
#19 0x00007f183e282691 in KLocale::formatDate (this=<optimized out>, date=..., format=<optimized out>) at ../../kdecore/localization/klocale.cpp:370
#20 0x00007f183bfe27af in AdiumThemeView::replaceHeaderKeywords(QString, AdiumThemeHeaderInfo const&) () from /usr/lib/libktpchat.so.0
#21 0x00007f183bfe3c76 in AdiumThemeView::initialise(AdiumThemeHeaderInfo const&) () from /usr/lib/libktpchat.so.0
#22 0x00007f183bfd8215 in ChatWidget::initChatArea() () from /usr/lib/libktpchat.so.0
#23 0x00007f183bfd8c2c in ChatWidget::ChatWidget(Tp::SharedPtr<Tp::TextChannel> const&, Tp::SharedPtr<Tp::Account> const&, QWidget*) () from /usr/lib/libktpchat.so.0
#24 0x0000000000418551 in _start ()
Comment 3 David Edmundson 2014-02-24 22:52:14 UTC
On Rohan's machine the lock was caused by appmenu, the tool to put window titles in the application menu bar.

kded (where kded resides) sends a blocking call to us for the window data, we send one of two blocking calls to the kded:
 - kdatetime asking for the time
 - khtml asks if we have network access.

KDED should never ever ever ever send a blocking call, so it's app menu in the wrong. I believe I have a patch; but need someone to test.
Comment 4 Christoph Feck 2014-03-07 22:22:53 UTC
See also bug 331439.

David, if you have a patch, open a review request :)
Comment 5 Thiago Jung Bauermann 2014-11-07 01:50:03 UTC
I'm having this problem on KDE 4.14.2, KDE Telepathy 0.9 on Kubuntu 14.04 LTS. I use application menus on the top of the screen.

The problem went away when I changed the setting for application menus to show up in the application itself.
Comment 6 Martin Klapetek 2014-11-07 10:41:39 UTC
*** Bug 340695 has been marked as a duplicate of this bug. ***
Comment 7 goo 2015-02-23 00:53:56 UTC
This problem is still present with KDE 4.14.2 and ktp 0.9 on Kubuntu 14.10.
Comment 8 Martin Klapetek 2015-07-31 16:40:16 UTC
This should now be fixed with 15.08.

Please reopen if you still have issues with the latest version.

Thanks
Comment 9 Martin Klapetek 2015-07-31 16:40:46 UTC
I forgot to mention 15.08 _and_ Plasma 5.3.