Bug 339122 - kinit stop loading services if one fails to load, resulting in plasmashell and others not loading
Summary: kinit stop loading services if one fails to load, resulting in plasmashell an...
Status: RESOLVED DUPLICATE of bug 328571
Alias: None
Product: frameworks-kinit
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-16 15:27 UTC by AnAkkk
Modified: 2014-09-19 21:06 UTC (History)
3 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 AnAkkk 2014-09-16 15:27:32 UTC
I've bought a new laptop and installed Plasma 5 with ArchLinux AUR packages. Almost every time I boot my computer, only 2 services from /etc/xdg/autostart are ran, then it stops, which mean I get a black screen as plasmashell isn't loaded.

I've added many debug messages in klauncher.cpp, and I can see that the krunner service seem to die as the following method is called:
KLauncher::processDied(pid_t pid, long exitStatus)

The problem is that it doesn't pass the "if (request->pid == pid)" condition (request->pid is set to 0 in KLauncher::start_service), which means requestDone(request) never gets called.
If requestDone isn't called, mAutotimer isn't reset, so it hangs here and doesn't run any other services.

I know the issue seem to be krunner, but I guess this needs to be fixed too.

Reproducible: Always
Comment 1 AnAkkk 2014-09-16 15:35:09 UTC
Actually krunner doesn't even crash, there's a first krunner process spawned, which seem to fork itself and exit (return code 0). krunner runs perfectly fine, the issue seem to just be kinit.
Comment 2 AnAkkk 2014-09-16 15:40:56 UTC
request->pid is actually set in requestStart if USE_KPROCESS_FOR_KIOSLAVES is defined, but that isn't set by default. This means it'll always be 0, and the condition always fails in KLauncher::processDied.
Comment 3 AnAkkk 2014-09-18 12:10:59 UTC
I've removed krunner.desktop, and now I have the same issue with plasmashell.desktop. 
The plasmashell process runs correctly, the desktop appears, but requestDone is never called, which means other .desktop files (such as kmix, pulseaudio, etc) are never ran. I could reproduce the same issue on another computer a few times.
Comment 4 AnAkkk 2014-09-18 12:14:13 UTC
Sorry for the multiple messages.
When I have that bug, I have exactly the same problem as in https://bugs.kde.org/show_bug.cgi?id=328571, so I'm pretty sure it's the same issue.
Comment 5 Rex Dieter 2014-09-18 13:26:56 UTC
Does the workaround from bug #328571 (QT_NO_GLIB=1 )help ?
Comment 6 AnAkkk 2014-09-18 17:15:19 UTC
I've restarted 4 times with that workaround, I haven't seen the issue. It's quite random though, maybe it'll come back on the next boots.

If it doesn't, I'll try with USE_KPROCESS_FOR_KIOSLAVES.
Comment 7 AnAkkk 2014-09-18 17:24:09 UTC
I've removed QT_NO_GLIB=1 and the issue came back on the next boot.

I've tried to compile kinit with USE_KPROCESS_FOR_KIOSLAVES to avoid the buggy code, but this prevents SDDM from working, I have no display after I set that. Judging by the code it's only supposed to be for Windows/OSX though.
Comment 8 AnAkkk 2014-09-18 17:52:57 UTC
QT_NO_GLIB=1 breaks PulseAudio integration though, so it's not really a good workaround :/
See https://bbs.archlinux.org/viewtopic.php?id=113254
Comment 9 Rex Dieter 2014-09-18 18:01:13 UTC
Not if you use the patch from the other bug, so that the NO_GLIB hack is applied only to autostart items (at least it's worked fine for me and fedora users in testing).
Comment 10 AnAkkk 2014-09-18 18:02:35 UTC
Does that patch work for kinit from KF5?
Comment 11 Rex Dieter 2014-09-18 18:04:08 UTC
I dont know, we've only used it with kdelibs-4.x.  It theoretically shouldn't be too hard to port to kf5's kinit, it is fairly simple.
Comment 12 AnAkkk 2014-09-19 17:19:02 UTC
Ok, will test it out later. Maybe someone can do a correct fix though since I've explained the issue in my first post.
Comment 13 AnAkkk 2014-09-19 20:43:24 UTC
After some testing and trying to understand the code, what I've said in my first post isn't entirely true. 
Yes, it'll never pass the "if (request->pid == pid)" condition, but that part of code seem to be useless/unneeded anyway. 
My services are launched in this order:
1. baloo_file
2. krunner
3. plasmashell
etc.

I thought processDied was called on krunner, but it's actually on baloo_file (and I guess it's normal), krunner is launched fine.
The issue is still that mAutotimer isn't reset after krunner is ran, so the next service (plasmashell) isn't ran. I'm still not sure why, trying to find out.
Comment 14 AnAkkk 2014-09-19 20:54:56 UTC
I've checked which functions get called when it works, and it's actually KLauncher::slotNameOwnerChanged, which calls requestDone and reset mAutotimer.

This look like a Qt5 and/or DBus issue, and I don't know enough to debug this unfortunately. Since it works after restarting the DM, maybe it's because some dbus process is launched too late on the 1st run?
Comment 15 AnAkkk 2014-09-19 21:06:48 UTC
I'll just mark this as a duplicate of the other one.

*** This bug has been marked as a duplicate of bug 328571 ***