Bug 335069 - Kickoff freezes after app clicked until its started
Summary: Kickoff freezes after app clicked until its started
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Launcher (Kickoff) (show other bugs)
Version: master
Platform: unspecified Linux
: NOR normal
Target Milestone: 1.0
Assignee: Sebastian Kügler
URL: http://youtu.be/Z65XcY9muAs
Keywords:
: 335288 (view as bug list)
Depends on: 335481 335602
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-20 09:42 UTC by Leszek Lesner
Modified: 2015-11-16 06:27 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leszek Lesner 2014-05-20 09:42:00 UTC
When I for example launch kate and the kickoff menu closes but kate isn't started yet I am unable to open the kickoff menu again until kate is started. 

Video Demo: http://youtu.be/Z65XcY9muAs

PS: Also not sure if related if I try to start kwrite it starts successfully but then plasmashell crashes (maybe because kickoff waits for a "I am started" signal from kwrite which it does not send in contrast to kate !?)

Reproducible: Always

Steps to Reproduce:
1. Open Kickoff menu
2. Click kate
3. Try to open kickoff before kate is started
Actual Results:  
It does not open kickoff

Expected Results:  
It should open kickoff menu again. 

Tested on neon5 build (state: 20.05.2014)
Comment 1 Leszek Lesner 2014-05-20 09:43:22 UTC
PPS: This problem does not happen with dolphin or systemsettings.
Comment 2 Marco Martin 2014-05-20 17:19:03 UTC
Maybe is a problem in the Krun class?
Comment 3 Hrvoje Senjan 2014-05-23 19:31:41 UTC
this can be reproducible with almost 100% certainty when launching kinfocenter
Comment 4 David Edmundson 2014-05-28 05:39:40 UTC
Confirming.

Backtrace when blocked:


#0  0x00007f0122fd135d in poll () from /usr/lib/libc.so.6
#1  0x00007f01183edc98 in ?? () from /usr/lib/libdbus-1.so.3
#2  0x00007f01183ecc3f in ?? () from /usr/lib/libdbus-1.so.3
#3  0x00007f01183d63ec in ?? () from /usr/lib/libdbus-1.so.3
#4  0x00007f01183d6edc in ?? () from /usr/lib/libdbus-1.so.3
#5  0x00007f01183d73a5 in dbus_connection_send_with_reply_and_block () from /usr/lib/libdbus-1.so.3
#6  0x00007f012b8f3b73 in q_dbus_connection_send_with_reply_and_block (connection=0x186e760, message=0x4809120, timeout_milliseconds=2147483647, error=0x7fff3453a3d0)
    at qdbus_symbols_p.h:135
#7  0x00007f012b8fe20e in QDBusConnectionPrivate::sendWithReply (this=0x186af00, message=..., sendMode=1, timeout=2147483647) at qdbusintegrator.cpp:1959
#8  0x00007f012b8ebf07 in QDBusConnection::call (this=0x7fff3453a8a0, message=..., mode=QDBus::Block, timeout=2147483647) at qdbusconnection.cpp:584
#9  0x00007f0126da0082 in KToolInvocation::startServiceInternal (this=0x7f012700bd80 <(anonymous namespace)::Q_QGS_s_self::innerFunction()::holder>, 
    _function=0x7f0126de8725 "start_service_by_desktop_path", _name=..., URLs=..., error=0x7fff3453aa90, serviceName=0x0, pid=0x7fff3453aa8c, startup_id=..., noWait=false, 
    workdir=...) at /home/david/projects/kde5/src/frameworks/kservice/src/kdeinit/ktoolinvocation.cpp:99
#10 0x00007f0126da07d7 in KToolInvocation::startServiceByDesktopPath (_name=..., URLs=..., error=0x7fff3453aa90, serviceName=0x0, pid=0x7fff3453aa8c, startup_id=..., noWait=false)
    at /home/david/projects/kde5/src/frameworks/kservice/src/kdeinit/ktoolinvocation.cpp:190
#11 0x00007f012754a221 in KRun::run (_service=..., _urls=..., window=0x0, tempFiles=false, suggestedFileName=..., asn=...)
    at /home/david/projects/kde5/src/frameworks/kio/src/widgets/krun.cpp:738
#12 0x00007f0127536633 in runApplication (_url=..., _serviceFile=...) at /home/david/projects/kde5/src/frameworks/kio/src/widgets/kdesktopfileactions.cpp:136
#13 0x00007f0127535fd9 in KDesktopFileActions::run (u=..., _is_local=true) at /home/david/projects/kde5/src/frameworks/kio/src/widgets/kdesktopfileactions.cpp:79
#14 0x00007f0127546bde in KRun::runUrl (u=..., _mimetype=..., window=0x0, tempFile=false, runExecutables=true, suggestedFileName=..., asn=...)
    at /home/david/projects/kde5/src/frameworks/kio/src/widgets/krun.cpp:174
#15 0x00007f012754c69b in KRun::foundMimeType (this=0x5bd8510, type=...) at /home/david/projects/kde5/src/frameworks/kio/src/widgets/krun.cpp:1184
#16 0x00007f012754c24f in KRun::mimeTypeDetermined (this=0x5bd8510, mimeType=...) at /home/david/projects/kde5/src/frameworks/kio/src/widgets/krun.cpp:1132
#17 0x00007f012754b0db in KRun::init (this=0x5bd8510) at /home/david/projects/kde5/src/frameworks/kio/src/widgets/krun.cpp:887
#18 0x00007f012754bad5 in KRun::slotTimeout (this=0x5bd8510) at /home/david/projects/kde5/src/frameworks/kio/src/widgets/krun.cpp:1012
#19 0x00007f012754d216 in KRun::qt_static_metacall (_o=0x5bd8510, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fff3453b4a0)
    at /home/david/projects/kde5/build/frameworks/kio/src/widgets/moc_krun.cpp:98
#20 0x00007f0123dc9882 in QMetaObject::activate (sender=0x5e3d440, signalOffset=3, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3680
#21 0x00007f0123dc9090 in QMetaObject::activate (sender=0x5e3d440, m=0x7f012426a660 <QTimer::staticMetaObject>, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3546
#22 0x00007f0123e5a50b in QTimer::timeout (this=0x5e3d440) at .moc/moc_qtimer.cpp:191
#23 0x00007f0123dd477d in QTimer::timerEvent (this=0x5e3d440, e=0x7fff3453bf30) at kernel/qtimer.cpp:255

It seems to be a blocking dbus call in KToolInvocation.
Comment 5 David Edmundson 2014-05-28 05:47:22 UTC
This line is interesting.

#9  0x00007f0126da0082 in KToolInvocation::startServiceInternal (this=0x7f012700bd80 <(anonymous namespace)::Q_QGS_s_self::innerFunction()::holder>, 
    _function=0x7f0126de8725 "start_service_by_desktop_path", _name=..., URLs=..., error=0x7fff3453aa90, serviceName=0x0, pid=0x7fff3453aa8c, startup_id=..., noWait=false, 

We call 
    int result = KToolInvocation::startServiceByDesktopPath(url.pathOrUrl(), QStringList(), 0, 0, 0, "", true);

with noWait=true, yet internally that ends up calling a function with noWait=false
Comment 6 David Edmundson 2014-05-28 14:39:21 UTC
*** Bug 335288 has been marked as a duplicate of this bug. ***
Comment 7 David Edmundson 2014-05-28 15:37:31 UTC
Edit: We use KRun to load apps.
The other KToolInvokation was a red herring.

Reporting a bug against klauncher which is failing to respond to the dbus call to start things.
See bug 335481

We should also consider making KRun async and not block waiting for a response.
Comment 8 David Edmundson 2014-05-29 13:14:59 UTC
It turns out this was a problem in kinfocentre. 

Any DBus unique or multi application that brute force ported from KApplication -> QApplication without updating to use KDBusAddons causes everything to lock up.

This means we have a lot of apps to fix.

I've fixed kinfocentre and will fix kate, but more may be broken.

PLEASE HELP TEST ALL APPLICATIONS 

you can run 
$ dbus-send --print-reply --dest=org.kde.klauncher5 /KLauncher org.kde.KLauncher.start_service_by_desktop_path string:"/opt/kde5/share/applications/kinfocenter.desktop" array:string: array:string: string:"" boolean:false

where the path can be any .desktop file it should return and print something immediately.

 If it does not, we have to fix something. Please tell me of any broken apps.
Comment 9 David Edmundson 2014-05-30 17:13:03 UTC
Apps found with:
$ find -name '*.desktop' | xargs grep "X-DBUS-StartupType" -l

./share/applications/org.kde.konsole.desktop OK
./share/applications/org.kate-editor.kwrite.desktop INVALID. Clean out your system
./share/applications/org.kde.kate.desktop OK
./share/applications/kdepasswd.desktop OK
./share/applications/okteta.desktop ??? Crashes on load anyway
./share/applications/yakuake.desktop
./share/applications/kdesystemsettings.desktop OK
./share/applications/systemsettings.desktop OK
./share/applications/ksysguard.desktop CAN'T TEST
./share/applications/kfontview.desktop OK
./share/applications/kinfocenter.desktop FIXED
./share/applications/kmenuedit.desktop OK
./share/applications/klipper.desktop WON'T LOAD?
./share/applications/org.kde.kwrite.desktop OK

Can someone test klipper, and ksysguard for me using the dbus-send command above.
After that I think we can close this.

(I'd still like to make KToolnvokation async, but that's another bug)
Comment 10 David Edmundson 2014-06-01 12:26:28 UTC
./share/applications/klipper.desktop 
./share/applications/ksysguard.desktop 

are both fixed (now)
Comment 11 Leslie Zhai 2015-11-16 06:27:22 UTC
Hi David,

gwenview freezes the kicker when open a *.svg file!

KF5: v5.16.0
plasma-desktop: v5.4.90
Qt5: v5.5.1