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
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.
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.
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.
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.
Does the workaround from bug #328571 (QT_NO_GLIB=1 )help ?
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.
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.
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
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).
Does that patch work for kinit from KF5?
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.
Ok, will test it out later. Maybe someone can do a correct fix though since I've explained the issue in my first post.
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.
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?
I'll just mark this as a duplicate of the other one. *** This bug has been marked as a duplicate of bug 328571 ***