Bug 315017

Summary: kded crashed while plug off the A/C
Product: [Unmaintained] solid Reporter: Toralf Förster <toralf.foerster>
Component: powermanagement-daemonAssignee: Dario Freddi <drf>
Status: RESOLVED FIXED    
Severity: crash CC: afiestas, dantti12, kavol, valir, whitebuffalo00
Priority: NOR    
Version: 4.10.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.10.5
Sentry Crash Report:
Attachments: grep -i kded .xsession-errors
New crash information added by DrKonqi
New crash information added by DrKonqi

Description Toralf Förster 2013-02-12 20:09:05 UTC
Application: kded4 ($Id$)
KDE Platform Version: 4.10.00 (Compiled from sources)
Qt Version: 4.8.4
Operating System: Linux 3.7.7 i686
Distribution: "Gentoo Base System release 2.1"

-- Information about the crash:
- What I was doing when the application crashed:

I changed in "Configure Advanced Power Management Settings" the value for "BAttery is at critical level" from 5 to 10, thenI plugged of the power and the crash occured.

-- Backtrace:
Application: KDE Daemon (kdeinit4), signal: Segmentation fault
Using host libthread_db library "/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0xb5b23740 (LWP 16376))]

Thread 2 (Thread 0xb18e2b40 (LWP 16385)):
#0  0x46b977db in __GI_clock_gettime (clock_id=1, tp=0xb18e1f98) at ../sysdeps/unix/clock_gettime.c:100
#1  0xb6e09b55 in do_gettime (frac=0xb18e1f90, sec=0xb18e1f88) at tools/qelapsedtimer_unix.cpp:123
#2  qt_gettime () at tools/qelapsedtimer_unix.cpp:140
#3  0xb6ef6466 in QTimerInfoList::updateCurrentTime (this=0xb0f02074) at kernel/qeventdispatcher_unix.cpp:354
#4  0xb6ef67ca in QTimerInfoList::timerWait (this=0xb0f02074, tm=...) at kernel/qeventdispatcher_unix.cpp:461
#5  0xb6ef4f53 in timerSourcePrepareHelper (src=<optimized out>, timeout=0xb18e209c) at kernel/qeventdispatcher_glib.cpp:136
#6  0xb6ef4ff5 in timerSourcePrepare (source=0xb0f02040, timeout=<optimized out>) at kernel/qeventdispatcher_glib.cpp:169
#7  0x46cf2932 in g_main_context_prepare (context=0xb0f004e0, priority=0xb18e20f8) at gmain.c:2836
#8  0x46cf307f in g_main_context_iterate (dispatch=1, block=1, context=0xb0f004e0, self=<optimized out>) at gmain.c:3126
#9  g_main_context_iterate (context=0xb0f004e0, block=1, dispatch=1, self=<optimized out>) at gmain.c:3083
#10 0x46cf32d1 in g_main_context_iteration (context=0xb0f004e0, may_block=1) at gmain.c:3207
#11 0xb6ef5a1f in QEventDispatcherGlib::processEvents (this=0xb0f00468, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#12 0xb6ec139d in QEventLoop::processEvents (this=0xb18e2220, flags=...) at kernel/qeventloop.cpp:149
#13 0xb6ec1639 in QEventLoop::exec (this=0xb18e2220, flags=...) at kernel/qeventloop.cpp:204
#14 0xb6da7d7c in QThread::exec (this=0x954e550) at thread/qthread.cpp:542
#15 0xb6e9e3bd in QInotifyFileSystemWatcherEngine::run (this=0x954e550) at io/qfilesystemwatcher_inotify.cpp:256
#16 0xb6dab2c8 in QThreadPrivate::start (arg=0x954e550) at thread/qthread_unix.cpp:338
#17 0x46b2bdef in start_thread (arg=0xb18e2b40) at pthread_create.c:305
#18 0x46a6b41e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:133

Thread 1 (Thread 0xb5b23740 (LWP 16376)):
[KCrash Handler]
#7  Private (other=..., this=0xbffa37b0) at kernel/qvariant.h:356
#8  QVariant::QVariant (this=0xbffa37b0, p=...) at kernel/qvariant.cpp:1423
#9  0xb5eaa2e5 in QDBusPendingReplyData::argumentAt (this=0xbffa37c4, index=0) at qdbuspendingreply.cpp:270
#10 0xb19c6342 in argumentAt<0> (this=0xbffa37c4) at /usr/include/qt4/QtDBus/qdbuspendingreply.h:176
#11 value (this=0xbffa37c4) at /usr/include/qt4/QtDBus/qdbuspendingreply.h:181
#12 PowerDevil::PolicyAgent::requirePolicyCheck (this=0x967e888, policies=...) at /var/tmp/portage/kde-base/powerdevil-4.10.0/work/powerdevil-4.10.0/powerdevil/daemon/powerdevilpolicyagent.cpp:386
#13 0xb19b5809 in PowerDevil::Core::loadProfile (this=0x95ecda0, force=true) at /var/tmp/portage/kde-base/powerdevil-4.10.0/work/powerdevil-4.10.0/powerdevil/daemon/powerdevilcore.cpp:256
#14 0xb19b86c2 in PowerDevil::Core::refreshStatus (this=0x95ecda0) at /var/tmp/portage/kde-base/powerdevil-4.10.0/work/powerdevil-4.10.0/powerdevil/daemon/powerdevilcore.cpp:239
#15 0xb1a0e0b1 in PowerManagementAdaptor::refreshStatus (this=0x95ee268) at /var/tmp/portage/kde-base/powerdevil-4.10.0/work/powerdevil-4.10.0_build/powerdevil/daemon/powermanagementadaptor.cpp:75
#16 0xb1a0e518 in qt_static_metacall (_a=0xbffa3cf8, _id=11, _o=0x95ee268, _c=<optimized out>) at /var/tmp/portage/kde-base/powerdevil-4.10.0/work/powerdevil-4.10.0_build/powerdevil/daemon/powermanagementadaptor.moc:125
#17 PowerManagementAdaptor::qt_static_metacall (_o=0x95ee268, _c=QMetaObject::InvokeMetaMethod, _id=11, _a=0xbffa3cf8) at /var/tmp/portage/kde-base/powerdevil-4.10.0/work/powerdevil-4.10.0_build/powerdevil/daemon/powermanagementadaptor.moc:103
#18 0xb1a0e5ec in PowerManagementAdaptor::qt_metacall (this=0x95ee268, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0xbffa3cf8) at /var/tmp/portage/kde-base/powerdevil-4.10.0/work/powerdevil-4.10.0_build/powerdevil/daemon/powermanagementadaptor.moc:169
#19 0xb5e687ed in QDBusConnectionPrivate::deliverCall (this=0x94daa88, object=0x95ee268, msg=..., metaTypes=..., slotIdx=0) at qdbusintegrator.cpp:951
#20 0xb5e69956 in QDBusConnectionPrivate::activateCall (this=0x94daa88, object=0x95ee268, flags=273, msg=...) at qdbusintegrator.cpp:856
#21 0xb5e6a20b in QDBusConnectionPrivate::activateObject (this=0x94daa88, node=..., msg=..., pathStartPos=-1074118992) at qdbusintegrator.cpp:1447
#22 0xb5e6a5a8 in QDBusActivateObjectEvent::placeMetaCall (this=0x968c6a8) at qdbusintegrator.cpp:1541
#23 0xb6edddcb in QObject::event (this=0x95ecda0, e=0x968c6a8) at kernel/qobject.cpp:1194
#24 0xb63d7e54 in notify_helper (e=0x968c6a8, receiver=0x95ecda0, this=0x94e3090) at kernel/qapplication.cpp:4562
#25 QApplicationPrivate::notify_helper (this=0x94e3090, receiver=0x95ecda0, e=0x968c6a8) at kernel/qapplication.cpp:4534
#26 0xb63dd22a in QApplication::notify (this=0x968c6a8, receiver=0x95ecda0, e=0x968c6a8) at kernel/qapplication.cpp:4291
#27 0xb751de91 in KApplication::notify (this=0xbffa4730, receiver=0x95ecda0, event=0x968c6a8) at /var/tmp/portage/kde-base/kdelibs-4.10.0/work/kdelibs-4.10.0/kdeui/kernel/kapplication.cpp:311
#28 0xb6ec2b0e in QCoreApplication::notifyInternal (this=0xbffa4730, receiver=0x95ecda0, event=0x968c6a8) at kernel/qcoreapplication.cpp:946
#29 0xb6ec67e4 in sendEvent (event=0x968c6a8, receiver=0x95ecda0) at kernel/qcoreapplication.h:231
#30 QCoreApplicationPrivate::sendPostedEvents (receiver=0x6f007400, event_type=0, data=0x42004400) at kernel/qcoreapplication.cpp:1570
#31 0xb6ec6b3c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1463
#32 0xb6ef55c4 in sendPostedEvents () at kernel/qcoreapplication.h:236
#33 postEventSourceDispatch (s=0x94e4100) at kernel/qeventdispatcher_glib.cpp:279
#34 0x46cf2e56 in g_main_dispatch (context=0x94e4300) at gmain.c:2539
#35 g_main_context_dispatch (context=0x94e4300) at gmain.c:3075
#36 0x46cf31f8 in g_main_context_iterate (dispatch=1, block=1188039600, context=0x94e4300, self=<optimized out>) at gmain.c:3146
#37 g_main_context_iterate (context=0x94e4300, block=1188039600, dispatch=1, self=<optimized out>) at gmain.c:3083
#38 0x46cf32d1 in g_main_context_iteration (context=0x94e4300, may_block=1) at gmain.c:3207
#39 0xb6ef59b7 in QEventDispatcherGlib::processEvents (this=0x947dda8, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#40 0xb648b70a in QGuiEventDispatcherGlib::processEvents (this=0x947dda8, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#41 0xb6ec139d in QEventLoop::processEvents (this=0xbffa4694, flags=...) at kernel/qeventloop.cpp:149
#42 0xb6ec1639 in QEventLoop::exec (this=0xbffa4694, flags=...) at kernel/qeventloop.cpp:204
#43 0xb6ec6bea in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#44 0xb63d5de4 in QApplication::exec () at kernel/qapplication.cpp:3823
#45 0xb5661369 in kdemain (argc=1, argv=0x94bb4f0) at /var/tmp/portage/kde-base/kdelibs-4.10.0/work/kdelibs-4.10.0/kded/kded.cpp:924
#46 0x0804fb8c in launch (argc=<optimized out>, _name=0x805265b "kded4", args=<optimized out>, cwd=0x0, envc=0, envs=<optimized out>, reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x805254e "0") at /var/tmp/portage/kde-base/kdelibs-4.10.0/work/kdelibs-4.10.0/kinit/kinit.cpp:726
#47 0x0804d087 in main (argc=1862300672, argv=0x2e007000, envp=0x42004400) at /var/tmp/portage/kde-base/kdelibs-4.10.0/work/kdelibs-4.10.0/kinit/kinit.cpp:1841

Possible duplicates by query: bug 314922, bug 307225, bug 306265, bug 304785, bug 297785.

Reported using DrKonqi
Comment 1 Toralf Förster 2013-02-12 20:09:43 UTC
Created attachment 77232 [details]
grep -i kded .xsession-errors
Comment 2 Alex Fiestas 2013-03-03 18:20:24 UTC
*** Bug 306265 has been marked as a duplicate of this bug. ***
Comment 3 Alex Fiestas 2013-03-12 15:19:20 UTC
*** Bug 289373 has been marked as a duplicate of this bug. ***
Comment 4 Dario Freddi 2013-04-20 14:20:48 UTC
It's quite a strange bug. This crashes upon ConsoleKit not being found or active, even though CK is correctly not found by powerdevil, hence it should never reach that block. Can you please tell us if you have either systemd or consolekit installed and running?
Comment 5 Toralf Förster 2013-04-20 14:55:55 UTC
(In reply to comment #4)
> It's quite a strange bug. This crashes upon ConsoleKit not being found or
> active, even though CK is correctly not found by powerdevil, hence it should
> never reach that block. Can you please tell us if you have either systemd or
> consolekit installed and running?

nope - it is an almost stbale Gentoo, so no systemd, but consolekit 0.4.5_p20120320-r1
Comment 6 Daniel Nicoletti 2013-05-06 02:48:20 UTC
This is a Qt bug, reported and fixed (Qt5), every time you see a crash around QDBusPendingReply::argumentAt<0> it's the same bug, to work around use QDBusReply or before retrieving the value use reply.isError().
Comment 7 Valentin Rusu 2013-05-06 14:14:50 UTC
<offtopic>oh that's why I had problems when implementing ksecretservice api! I also had crashes with that method call! Thanks for poiting this up.</offtopic>
Comment 8 kavol 2013-05-31 12:01:17 UTC
Created attachment 80214 [details]
New crash information added by DrKonqi

kded4 (4.10.3) on KDE Platform 4.10.3 using Qt 4.8.4

- What I was doing when the application crashed:

It crashed right after logging in. Meanwhile, I got some message about powermanagement problem, so I guess this is dupe.

$ grep -i kded .xsession-errors
kded(1313) PowerDevilUPowerBackend::isAvailable: Could not request activatable names to DBus! 
kded(1313): KDE Power Management System init failed! 
KCrash: Attempting to start /usr/bin/kded4 from kdeinit
KCrash: Application 'kded4' crashing...
kded(2025)/Network Management (NetworkManager backend) ConnectionDbus::fromDbusMap: Setting  "802-1x" not initialized

-- Backtrace (Reduced):
#6  Private (other=..., this=0x7fff13c20e40) at kernel/qvariant.h:356
#7  QVariant::QVariant (this=0x7fff13c20e40, p=...) at kernel/qvariant.cpp:1423
#8  0x0000003fb465bdcd in QDBusPendingReplyData::argumentAt (this=this@entry=0x7fff13c20e00, index=index@entry=0) at qdbuspendingreply.cpp:270
#9  0x00007f4c6e39fdcf in argumentAt<0> (this=0x7fff13c20e00) at /usr/include/QtDBus/qdbuspendingreply.h:176
#10 operator QDBusPendingReplyTypes::Select<0, unsigned int, void, void, void, void, void, void, void>::Type (this=0x7fff13c20e00) at /usr/include/QtDBus/qdbuspendingreply.h:186
Comment 9 kavol 2013-05-31 12:42:55 UTC
Created attachment 80216 [details]
New crash information added by DrKonqi

kded4 (4.10.3) on KDE Platform 4.10.3 using Qt 4.8.4

- What I was doing when the application crashed:

the same crash, seems reproducible on my system

-- Backtrace (Reduced):
#6  Private (other=..., this=0x7fffe7a7ae30) at kernel/qvariant.h:356
#7  QVariant::QVariant (this=0x7fffe7a7ae30, p=...) at kernel/qvariant.cpp:1423
#8  0x0000003fb465bdcd in QDBusPendingReplyData::argumentAt (this=this@entry=0x7fffe7a7adf0, index=index@entry=0) at qdbuspendingreply.cpp:270
#9  0x00007faf1bbcfdcf in argumentAt<0> (this=0x7fffe7a7adf0) at /usr/include/QtDBus/qdbuspendingreply.h:176
#10 operator QDBusPendingReplyTypes::Select<0, unsigned int, void, void, void, void, void, void, void>::Type (this=0x7fffe7a7adf0) at /usr/include/QtDBus/qdbuspendingreply.h:186
Comment 10 Daniel Nicoletti 2013-05-31 12:51:00 UTC
@kavol
The issue is already known, and the fix is on it's way, no further backtraces are needed.
Thanks.
Comment 11 Kai Uwe Broulik 2013-06-03 22:32:37 UTC
Git commit a781558d055c4840b2b322551e765e22d6be30f4 by Kai Uwe Broulik.
Committed on 04/06/2013 at 00:29.
Pushed by broulik into branch 'KDE/4.10'.

Don't access QDBusPendingReply value if it is not valid.

REVIEW: 110746
FIXED-IN: 4.10.5

M  +1    -1    powerdevil/daemon/powerdevilpolicyagent.cpp

http://commits.kde.org/kde-workspace/a781558d055c4840b2b322551e765e22d6be30f4