Bug 287560

Summary: KDE Daemon crashes on login
Product: solid Reporter: captainknots
Component: powermanagement-daemonAssignee: Dario Freddi <drf>
Status: RESOLVED FIXED    
Severity: crash CC: afiestas, aleixpol, alex.merry, cfeck, fischer, kollix, oliver.henshaw, rserral, simonandric5, vivo75+kde
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.9
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
Produced by "KDE Daemon - The KDE Crash Handler"

Description captainknots 2011-11-25 16:59:56 UTC
Version:           Git (using Devel) 
OS:                Linux

I logged into the KDE Desktop after installing the latest Project neon packages on Kubuntu 11.10 and immediately the daemon crashed

Reproducible: Always

Steps to Reproduce:
I logged out and logged back in.

Actual Results:  
The daemon crashed again

Expected Results:  
The daemon should have continued to run.

Application: KDE Daemon (kdeinit4), signal: Aborted
[Current thread is 1 (Thread 0x7f4e9ac84780 (LWP 22363))]

Thread 3 (Thread 0x7f4e7f9d0700 (LWP 22466)):
#0  0x00007f4e97e66773 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f4e94bacf68 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f4e94bad792 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f4e7feb1516 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007f4e94bd22b6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f4e9939defc in start_thread (arg=0x7f4e7f9d0700) at pthread_create.c:304
#6  0x00007f4e97e7289d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#7  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f4e7efbf700 (LWP 22467)):
#0  0x00007f4e97e66773 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f4e94bacf68 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f4e94bad429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f4e9978e24a in QEventDispatcherGlib::processEvents (this=0x14db7d0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#4  0x00007f4e99753388 in QEventLoop::processEvents (this=0x7f4e7efbed70, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f4e997534dc in QEventLoop::exec (this=0x7f4e7efbed70, flags=...) at kernel/qeventloop.cpp:201
#6  0x00007f4e9963715b in QThread::exec (this=0x14dabc0) at thread/qthread.cpp:498
#7  0x00007f4e9973250b in QInotifyFileSystemWatcherEngine::run (this=0x14dabc0) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f4e9963997f in QThreadPrivate::start (arg=0x14dabc0) at thread/qthread_unix.cpp:331
#9  0x00007f4e9939defc in start_thread (arg=0x7f4e7efbf700) at pthread_create.c:304
#10 0x00007f4e97e7289d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f4e9ac84780 (LWP 22363)):
[KCrash Handler]
#6  0x00007f4e97dc73a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x00007f4e97dcab0b in __GI_abort () at abort.c:92
#8  0x00007f4e9962ca17 in qt_message_output (msgType=QtFatalMsg, buf=0x1447e28 "ASSERT failure in KConfigGroup::groupImpl: \"can not have an unnamed child group\", file /build/buildd/project-neon-kdelibs-2+git20111124+r92227/kdecore/config/kconfiggroup.cpp, line 516") at global/qglobal.cpp:2291
#9  0x00007f4e9962cbad in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=QtFatalMsg, msg=0x7f4e997d4220 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=0x7fff76271928) at global/qglobal.cpp:2337
#10 0x00007f4e9962d33d in qFatal (msg=0x7f4e997d4220 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qglobal.cpp:2520
#11 0x00007f4e9962c61b in qt_assert_x (where=0x7f4e99d4a61b "KConfigGroup::groupImpl", what=0x7f4e99d4a638 "can not have an unnamed child group", file=0x7f4e99d4a2b8 "/build/buildd/project-neon-kdelibs-2+git20111124+r92227/kdecore/config/kconfiggroup.cpp", line=516) at global/qglobal.cpp:2044
#12 0x00007f4e99b89949 in KConfigGroup::groupImpl (this=0x7fff76271d40, aGroup=...) at /build/buildd/project-neon-kdelibs-2+git20111124+r92227/kdecore/config/kconfiggroup.cpp:516
#13 0x00007f4e99b869d0 in KConfigBase::group (this=0x7fff76271d40, str=...) at /build/buildd/project-neon-kdelibs-2+git20111124+r92227/kdecore/config/kconfigbase.cpp:51
#14 0x00007f4e83166fe9 in PowerDevil::Core::loadProfile (this=0x1441ea0, force=true) at /build/buildd/project-neon-kde-workspace-2+git20111125+r46259/powerdevil/daemon/powerdevilcore.cpp:267
#15 0x00007f4e83166c19 in PowerDevil::Core::refreshStatus (this=0x1441ea0) at /build/buildd/project-neon-kde-workspace-2+git20111125+r46259/powerdevil/daemon/powerdevilcore.cpp:236
#16 0x00007f4e8316614d in PowerDevil::Core::onBackendReady (this=0x1441ea0) at /build/buildd/project-neon-kde-workspace-2+git20111125+r46259/powerdevil/daemon/powerdevilcore.cpp:153
#17 0x00007f4e8316a51f in PowerDevil::Core::qt_metacall (this=0x1441ea0, _c=QMetaObject::InvokeMetaMethod, _id=24, _a=0x7fff76272660) at /build/buildd/project-neon-kde-workspace-2+git20111125+r46259/obj-x86_64-linux-gnu/powerdevil/daemon/powerdevilcore.moc:168
#18 0x00007f4e9975d99c in QMetaObject::metacall (object=0x1441ea0, cl=QMetaObject::InvokeMetaMethod, idx=28, argv=0x7fff76272660) at kernel/qmetaobject.cpp:237
#19 0x00007f4e99772710 in QMetaObject::activate (sender=0x12df520, m=0x7f4e8338d440, local_signal_index=5, argv=0x0) at kernel/qobject.cpp:3278
#20 0x00007f4e831642d1 in PowerDevil::BackendInterface::backendReady (this=0x12df520) at /build/buildd/project-neon-kde-workspace-2+git20111125+r46259/obj-x86_64-linux-gnu/powerdevil/daemon/powerdevilbackendinterface.moc:146
#21 0x00007f4e83163d4e in PowerDevil::BackendInterface::setBackendIsReady (this=0x12df520, availableBrightnessControls=..., supportedSuspendMethods=...) at /build/buildd/project-neon-kde-workspace-2+git20111125+r46259/powerdevil/daemon/powerdevilbackendinterface.cpp:120
#22 0x00007f4e8339ec1f in PowerDevilUPowerBackend::init (this=0x12df520) at /build/buildd/project-neon-kde-workspace-2+git20111125+r46259/powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp:151
#23 0x00007f4e83165a5f in PowerDevil::Core::loadCore (this=0x1441ea0, backend=0x12df520) at /build/buildd/project-neon-kde-workspace-2+git20111125+r46259/powerdevil/daemon/powerdevilcore.cpp:84
#24 0x00007f4e8339a77d in KDEDPowerDevil::init (this=0x13e5a90) at /build/buildd/project-neon-kde-workspace-2+git20111125+r46259/powerdevil/daemon/kdedpowerdevil.cpp:89
#25 0x00007f4e8339aba0 in KDEDPowerDevil::qt_metacall (this=0x13e5a90, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x13bd4f0) at /build/buildd/project-neon-kde-workspace-2+git20111125+r46259/obj-x86_64-linux-gnu/powerdevil/daemon/kdedpowerdevil.moc:73
#26 0x00007f4e9975d99c in QMetaObject::metacall (object=0x13e5a90, cl=QMetaObject::InvokeMetaMethod, idx=8, argv=0x13bd4f0) at kernel/qmetaobject.cpp:237
#27 0x00007f4e9976cf24 in QMetaCallEvent::placeMetaCall (this=0x12de5c0, object=0x13e5a90) at kernel/qobject.cpp:535
#28 0x00007f4e9976e1a0 in QObject::event (this=0x13e5a90, e=0x12de5c0) at kernel/qobject.cpp:1217
#29 0x00007f4e986293b8 in QApplicationPrivate::notify_helper (this=0x12e0a50, receiver=0x13e5a90, e=0x12de5c0) at kernel/qapplication.cpp:4509
#30 0x00007f4e986269d6 in QApplication::notify (this=0x7fff76273a80, receiver=0x13e5a90, e=0x12de5c0) at kernel/qapplication.cpp:3909
#31 0x00007f4e9a5b225f in KApplication::notify (this=0x7fff76273a80, receiver=0x13e5a90, event=0x12de5c0) at /build/buildd/project-neon-kdelibs-2+git20111124+r92227/kdeui/kernel/kapplication.cpp:311
#32 0x00007f4e997557c2 in QCoreApplication::notifyInternal (this=0x7fff76273a80, receiver=0x13e5a90, event=0x12de5c0) at kernel/qcoreapplication.cpp:787
#33 0x00007f4e99759545 in QCoreApplication::sendEvent (receiver=0x13e5a90, event=0x12de5c0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#34 0x00007f4e997569e6 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x125c5e0) at kernel/qcoreapplication.cpp:1428
#35 0x00007f4e99756607 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1321
#36 0x00007f4e9978e977 in QCoreApplication::sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#37 0x00007f4e9978d951 in postEventSourceDispatch (s=0x12e4500) at kernel/qeventdispatcher_glib.cpp:277
#38 0x00007f4e94baca5d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007f4e94bad258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 0x00007f4e94bad429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#41 0x00007f4e9978e227 in QEventDispatcherGlib::processEvents (this=0x125ed30, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#42 0x00007f4e98701534 in QGuiEventDispatcherGlib::processEvents (this=0x125ed30, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#43 0x00007f4e99753388 in QEventLoop::processEvents (this=0x7fff762739e0, flags=...) at kernel/qeventloop.cpp:149
#44 0x00007f4e997534dc in QEventLoop::exec (this=0x7fff762739e0, flags=...) at kernel/qeventloop.cpp:201
#45 0x00007f4e99755eb4 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1064
#46 0x00007f4e9862654e in QApplication::exec () at kernel/qapplication.cpp:3783
#47 0x00007f4e89511f16 in kdemain (argc=1, argv=0x12b1ee0) at /build/buildd/project-neon-kdelibs-2+git20111124+r92227/kded/kded.cpp:924
#48 0x0000000000406d04 in launch (argc=1, _name=0x40d9c2 "kded4", args=0x0, cwd=0x0, envc=0, envs=0x0, reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x40d287 "0") at /build/buildd/project-neon-kdelibs-2+git20111124+r92227/kinit/kinit.cpp:734
#49 0x0000000000409fff in main (argc=4, argv=0x7fff762742c8, envp=0x7fff762742f0) at /build/buildd/project-neon-kdelibs-2+git20111124+r92227/kinit/kinit.cpp:1849
Comment 1 Christoph Feck 2011-11-28 14:25:42 UTC
Might be a duplicate of bug 287039. Please check if the correct Activity Manager is running, as indicated in bug 287039 comment #1.
Comment 2 Francesco Riosa 2011-12-21 14:29:28 UTC
Created attachment 66985 [details]
New crash information added by DrKonqi

kded4 ($Id$) on KDE Platform 4.7.4 (4.7.4) using Qt 4.7.4

as bug opener, starting a new session of kde

-- Backtrace (Reduced):
#6  0x00007f8d49898ac5 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x00007f8d49899f3b in __GI_abort () at abort.c:93
[...]
#11 0x00007f8d4bd47b56 in KConfigGroup::groupImpl (this=0x7fff735716d0, aGroup=...) at /usr/src/debug/kde-base/kdelibs-9999/kdelibs-9999/kdecore/config/kconfiggroup.cpp:516
#12 0x00007f8d4bd44a27 in KConfigBase::group (this=0x7fff735716d0, str=<optimized out>) at /usr/src/debug/kde-base/kdelibs-9999/kdelibs-9999/kdecore/config/kconfigbase.cpp:51
#13 0x00007f8d334a9044 in PowerDevil::Core::loadProfile(bool) () from /usr/lib64/libpowerdevilcore.so.0
Comment 3 Dario Freddi 2012-01-15 01:39:22 UTC
*** Bug 290735 has been marked as a duplicate of this bug. ***
Comment 4 Alex Merry 2012-01-15 19:42:50 UTC
I get this crash, and kactivitymanagerd is running just fine for me.
Comment 5 Thijs 2012-01-18 15:02:23 UTC
*** Bug 291857 has been marked as a duplicate of this bug. ***
Comment 6 Aleix Pol 2012-02-08 22:53:21 UTC
Created attachment 68638 [details]
New crash information added by DrKonqi

kded4 ($Id$) on KDE Platform 4.8.00 (4.8.0) using Qt 4.8.0

- What I was doing when the application crashed:

Just logging in, boom. I don't really know much else.

-- Backtrace (Reduced):
#11 0x00007f55d929b1f9 in KConfigGroup::groupImpl (this=0x7fffa3ef5fb0, aGroup=...) at /home/kde-devel/src/kdelibs/kdecore/config/kconfiggroup.cpp:516
#12 0x00007f55d929826c in KConfigBase::group (this=0x7fffa3ef5fb0, str=...) at /home/kde-devel/src/kdelibs/kdecore/config/kconfigbase.cpp:51
#13 0x00007f55c144651f in PowerDevil::Core::loadProfile (this=0x126f110, force=true) at /home/kde-devel/src/kde-workspace/powerdevil/daemon/powerdevilcore.cpp:267
#14 0x00007f55c1446143 in PowerDevil::Core::refreshStatus (this=0x126f110) at /home/kde-devel/src/kde-workspace/powerdevil/daemon/powerdevilcore.cpp:236
#15 0x00007f55c14456bd in PowerDevil::Core::onBackendReady (this=0x126f110) at /home/kde-devel/src/kde-workspace/powerdevil/daemon/powerdevilcore.cpp:153
Comment 7 Christoph Feck 2012-02-26 20:31:16 UTC
Created attachment 69119 [details]
New crash information added by DrKonqi

kded4 ($Id$) on KDE Platform 4.8.00 (4.8.0) using Qt 4.8.0

- What I was doing when the application crashed:

Booting KDE from today's master/trunk => This crash.

-- Backtrace (Reduced):
#6  0xb5a5e8c5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0xb5a601d5 in __GI_abort () at abort.c:93
[...]
#11 0xb6a6a878 in qt_assert_x (where=0xb7018a57 "KConfigGroup::groupImpl", what=0xb7018a70 "can not have an unnamed child group", file=0xb7018710 "/local/git/KDE/libs/kdelibs/kdecore/config/kconfiggroup.cpp", line=516) at /local/git/Qt/frameworks/qt/src/corelib/global/qglobal.cpp:2007
#12 0xb6e6e2d8 in KConfigGroup::groupImpl (this=0xbfbbb8e0, aGroup=...) at /local/git/KDE/libs/kdelibs/kdecore/config/kconfiggroup.cpp:516
#13 0xb6e6b446 in KConfigBase::group (this=0xbfbbb8e0, str=...) at /local/git/KDE/libs/kdelibs/kdecore/config/kconfigbase.cpp:51
Comment 8 Thomas Fischer 2012-06-05 21:13:52 UTC
I can reproduce this bug on a Gentoo Linux system, using KDE 4.8.3 and Qt 4.8.1:
- Created a new empty user, removed all (hidden) files from home except for some Bash files
- Using a combination of su, export DISPLAY, and Xephyr to setup an X-in-X environment
- Run "startkde" from prompt
- Just wait for crash

The kactivitymanagerd process is running. However, checking the output on stdout/stderror, I found the following two lines:
kded(20117) PowerDevil::Core::loadProfile: We are now into activity  ""
kded(20205) PowerDevil::Core::loadProfile: We are now into activity  ""
which seem to match the debug output in powerdevil/daemon/powerdevilcore.cpp (line 262):
kDebug() << "We are now into activity " << activity;
The previous call on m_activityConsumer->currentActivity() seem to return an empty string.

Restarting the KDE environment in the same way a second time does not crash (at least not here).

I am wildly guessing here, but given that this crash happened in a completely fresh environment without any KDE_HOME, there may be no activity (yet) configured. So, either the documentation of currentActivity should state that an empty string may be returned for "no activity configured" (and all callers have to cope with this situation with crashing), or in case that there is no activity, a default/empty activity has to be configured first. My guess is that such activities will be created, but only too late.

As a side note, the PowerDevil's code here contains a lot of multiple magical strings like "actLike". Those should be refactored into class constants.
Comment 9 Christoph Feck 2012-08-16 12:01:29 UTC
*** Bug 305230 has been marked as a duplicate of this bug. ***
Comment 10 Samuel 2013-02-25 04:36:58 UTC
Created attachment 77561 [details]
Produced by "KDE Daemon - The KDE Crash Handler"

This crash occurs after login and when my ASUS R501V Laptop has its VGA output connected to a Cramer VGA Auto Switcher.  This system is used at a Church that I attend.  It occurs every time I connect and boot.

At home this problem does not occur where I use a normal VGA connection to an additional monitor.
Comment 11 Oliver Henshaw 2013-03-01 16:11:06 UTC
(In reply to comment #10)
> Created attachment 77561 [details]
> Produced by "KDE Daemon - The KDE Crash Handler"
> 
> This crash occurs after login and when my ASUS R501V Laptop has its VGA
> output connected to a Cramer VGA Auto Switcher.  This system is used at a
> Church that I attend.  It occurs every time I connect and boot.
> 
> At home this problem does not occur where I use a normal VGA connection to
> an additional monitor.

This one looks like a (lib)kscreen problem. Can you file a separate bug for this?
Comment 12 Alex Fiestas 2013-03-03 16:14:54 UTC
Dario/Oliver can we add some code to prevent null activity crashing us?
Comment 13 Oliver Henshaw 2013-03-03 16:55:54 UTC
(In reply to comment #12)
> Dario/Oliver can we add some code to prevent null activity crashing us?

I think you already have! See commit e1c13947e2bd83b3352b951fe2b45073170a4f97 which went into 4.9. but not 4.8.x. I only see reports of this problem on 4.8.x so I suspect that this is indeed fixed.

Please re-open or comment if I've assumed wrongly and anyone does see the on recent KDE releases.