Bug 312836 - KDED crashes when KScreen::Config::current() returns null
Summary: KDED crashes when KScreen::Config::current() returns null
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: kded (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Alex Fiestas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-07 18:32 UTC by Achim Bohnet
Modified: 2013-01-07 21:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
xrandr log (5.25 KB, text/x-log)
2013-01-07 18:35 UTC, Achim Bohnet
Details
kscreen console log (3.15 KB, text/x-log)
2013-01-07 18:37 UTC, Achim Bohnet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Bohnet 2013-01-07 18:32:53 UTC
Application: kded4 ($Id$)
KDE Platform Version: 4.9.97 (Compiled from sources)
Qt Version: 4.8.3
Operating System: Linux 3.5.0-21-generic x86_64
Distribution: Ubuntu 12.10

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

I've execute a script with content:

qdbus org.kde.kded /kded org.kde.kded.unloadModule randrmonitor
qdbus org.kde.kded /kded org.kde.kded.setModuleAutoloading randrmonitor false
qdbus org.kde.kded /kded org.kde.kded.loadModule kscreen

at this time no external monitor was connected.

-- Backtrace:
Application: KDE Dæmon (kdeinit4), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f6f8fa51780 (LWP 2449))]

Thread 5 (Thread 0x7f6f75bd2700 (LWP 2519)):
#0  0x00007f6f92423fc0 in __pthread_mutex_lock (mutex=0x7f6f68000a60) at pthread_mutex_lock.c:113
#1  0x00007f6f91b85e21 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f6f91b48623 in g_main_context_prepare () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6f91b48cab in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f6f91b48ea4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f6f96078c16 in QEventDispatcherGlib::processEvents (this=0x7f6f680008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#6  0x00007f6f960492bf in QEventLoop::processEvents (this=this@entry=0x7f6f75bd1dd0, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007f6f96049548 in QEventLoop::exec (this=0x7f6f75bd1dd0, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007f6f95f4ab10 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#9  0x00007f6f960299af in QInotifyFileSystemWatcherEngine::run (this=0x1e25be0) at io/qfilesystemwatcher_inotify.cpp:248
#10 0x00007f6f95f4daec in QThreadPrivate::start (arg=0x1e25be0) at thread/qthread_unix.cpp:338
#11 0x00007f6f92421e9a in start_thread (arg=0x7f6f75bd2700) at pthread_create.c:308
#12 0x00007f6f94c57cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#13 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f6f74b13700 (LWP 2645)):
#0  0x00007f6f960786f7 in timerSourceCheck (source=0x7f6f6c002800) at kernel/qeventdispatcher_glib.cpp:175
#1  0x00007f6f91b4888c in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f6f91b48d22 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6f91b48ea4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f6f96078c16 in QEventDispatcherGlib::processEvents (this=0x7f6f6c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#5  0x00007f6f960492bf in QEventLoop::processEvents (this=this@entry=0x7f6f74b12dd0, flags=...) at kernel/qeventloop.cpp:149
#6  0x00007f6f96049548 in QEventLoop::exec (this=0x7f6f74b12dd0, flags=...) at kernel/qeventloop.cpp:204
#7  0x00007f6f95f4ab10 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#8  0x00007f6f960299af in QInotifyFileSystemWatcherEngine::run (this=0x21d7d60) at io/qfilesystemwatcher_inotify.cpp:248
#9  0x00007f6f95f4daec in QThreadPrivate::start (arg=0x21d7d60) at thread/qthread_unix.cpp:338
#10 0x00007f6f92421e9a in start_thread (arg=0x7f6f74b13700) at pthread_create.c:308
#11 0x00007f6f94c57cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#12 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f6f62f86700 (LWP 2646)):
#0  0x00007f6f94c4c303 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f6f91b48d84 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f6f91b48ea4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6f96078c16 in QEventDispatcherGlib::processEvents (this=0x7f6f540008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007f6f960492bf in QEventLoop::processEvents (this=this@entry=0x7f6f62f85e00, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f6f96049548 in QEventLoop::exec (this=0x7f6f62f85e00, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f6f95f4ab10 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f6f95f4daec in QThreadPrivate::start (arg=0x225f220) at thread/qthread_unix.cpp:338
#8  0x00007f6f92421e9a in start_thread (arg=0x7f6f62f86700) at pthread_create.c:308
#9  0x00007f6f94c57cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f6f62785700 (LWP 2647)):
#0  0x00007f6f94c4c303 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f6f91b48d84 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f6f91b48ea4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6f96078c16 in QEventDispatcherGlib::processEvents (this=0x7f6f5c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007f6f960492bf in QEventLoop::processEvents (this=this@entry=0x7f6f62784e00, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f6f96049548 in QEventLoop::exec (this=0x7f6f62784e00, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f6f95f4ab10 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f6f95f4daec in QThreadPrivate::start (arg=0x1e5c2f0) at thread/qthread_unix.cpp:338
#8  0x00007f6f92421e9a in start_thread (arg=0x7f6f62785700) at pthread_create.c:308
#9  0x00007f6f94c57cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f6f8fa51780 (LWP 2449)):
[KCrash Handler]
#6  QHash (other=..., this=0x7fff1eb33740) at /usr/include/qt4/QtCore/qhash.h:282
#7  KScreen::Config::outputs (this=0x0) at /home/allee/Sources/kscreen-ng/libkscreen-0.0+git2013010701/src/config.cpp:79
#8  0x00007f6f4f984e1e in KScreenDaemon::monitorConnectedChange (this=this@entry=0x24eb070) at /home/allee/Sources/kscreen-ng/kscreen-0.0+git2013010701/kded/daemon.cpp:152
#9  0x00007f6f4f985180 in KScreenDaemon::KScreenDaemon (this=0x24eb070, parent=<optimized out>) at /home/allee/Sources/kscreen-ng/kscreen-0.0+git2013010701/kded/daemon.cpp:60
#10 0x00007f6f4f985937 in KPluginFactory::createInstance<KScreenDaemon, QObject> (parentWidget=<optimized out>, parent=<optimized out>, args=...) at /usr/include/KDE/../kpluginfactory.h:477
#11 0x00007f6f965a57c5 in KPluginFactory::create (this=0x236d300, iface=0x7f6f965fc1c0 <qt_meta_stringdata_KDEDModule> "KDEDModule", parentWidget=0x0, parent=0x1c2f960, args=..., keyword=...) at ../../kdecore/util/kpluginfactory.cpp:203
#12 0x00007f6f82a07cd7 in create<KDEDModule> (args=..., parent=0x1c2f960, this=<optimized out>) at ../../kdecore/util/kpluginfactory.h:507
#13 Kded::loadModule (this=this@entry=0x1c2f960, s=..., onDemand=onDemand@entry=false) at ../../kded/kded.cpp:409
#14 0x00007f6f82a085bb in Kded::loadModule (this=0x1c2f960, obj=..., onDemand=<optimized out>) at ../../kded/kded.cpp:361
#15 0x00007f6f82a0b585 in KdedAdaptor::loadModule (this=<optimized out>, module=...) at ../../kded/kdedadaptor.cpp:44
#16 0x00007f6f82a0b88e in qt_static_metacall (_a=<optimized out>, _id=<optimized out>, _o=<optimized out>, _c=<optimized out>) at ./kdedadaptor.moc:70
#17 KdedAdaptor::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at ./kdedadaptor.moc:64
#18 0x00007f6f82a0b99b in KdedAdaptor::qt_metacall (this=0x1c36d40, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fff1eb33ca0) at ./kdedadaptor.moc:124
#19 0x00007f6f933c1ed3 in QDBusConnectionPrivate::deliverCall (this=this@entry=0x1c2bc60, object=object@entry=0x1c36d40, msg=..., metaTypes=..., slotIdx=4) at qdbusintegrator.cpp:947
#20 0x00007f6f933c2fd5 in QDBusConnectionPrivate::activateCall (this=this@entry=0x1c2bc60, object=0x1c36d40, flags=flags@entry=273, msg=...) at qdbusintegrator.cpp:857
#21 0x00007f6f933c394f in QDBusConnectionPrivate::activateObject (this=0x1c2bc60, node=..., msg=..., pathStartPos=<optimized out>) at qdbusintegrator.cpp:1423
#22 0x00007f6f933c3a2b in QDBusActivateObjectEvent::placeMetaCall (this=0x249d080) at qdbusintegrator.cpp:1537
#23 0x00007f6f9605f43e in QObject::event (this=0x1c2f960, e=<optimized out>) at kernel/qobject.cpp:1195
#24 0x00007f6f953f1e9c in QApplicationPrivate::notify_helper (this=this@entry=0x1c37bc0, receiver=receiver@entry=0x1c2f960, e=e@entry=0x249d080) at kernel/qapplication.cpp:4562
#25 0x00007f6f953f630a in QApplication::notify (this=0x7fff1eb34a80, receiver=0x1c2f960, e=0x249d080) at kernel/qapplication.cpp:4423
#26 0x00007f6f96dc3626 in KApplication::notify (this=0x7fff1eb34a80, receiver=0x1c2f960, event=0x249d080) at ../../kdeui/kernel/kapplication.cpp:311
#27 0x00007f6f9604a56e in QCoreApplication::notifyInternal (this=0x7fff1eb34a80, receiver=receiver@entry=0x1c2f960, event=event@entry=0x249d080) at kernel/qcoreapplication.cpp:915
#28 0x00007f6f9604e3f1 in sendEvent (event=0x249d080, receiver=0x1c2f960) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#29 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x1ba32b0) at kernel/qcoreapplication.cpp:1539
#30 0x00007f6f96078a63 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#31 postEventSourceDispatch (s=0x1c38f00) at kernel/qeventdispatcher_glib.cpp:279
#32 0x00007f6f91b48ab5 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007f6f91b48de8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007f6f91b48ea4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00007f6f96078bf6 in QEventDispatcherGlib::processEvents (this=0x1ba57d0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#36 0x00007f6f95496c1e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#37 0x00007f6f960492bf in QEventLoop::processEvents (this=this@entry=0x7fff1eb34800, flags=...) at kernel/qeventloop.cpp:149
#38 0x00007f6f96049548 in QEventLoop::exec (this=0x7fff1eb34800, flags=...) at kernel/qeventloop.cpp:204
#39 0x00007f6f9604e708 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#40 0x00007f6f82a073f0 in kdemain (argc=1, argv=0x1c19a40) at ../../kded/kded.cpp:924
#41 0x00000000004084c6 in launch (argc=argc@entry=1, _name=_name@entry=0x40b127 "kded4", args=args@entry=0x0, cwd=cwd@entry=0x0, envc=envc@entry=0, envs=<optimized out>, envs@entry=0x0, reset_env=reset_env@entry=false, tty=tty@entry=0x0, avoid_loops=avoid_loops@entry=false, startup_id_str=startup_id_str@entry=0x40afb6 "0") at ../../kinit/kinit.cpp:738
#42 0x0000000000405a29 in main (argc=4, argv=<optimized out>, envp=0x7fff1eb35480) at ../../kinit/kinit.cpp:1853

Reported using DrKonqi
Comment 1 Achim Bohnet 2013-01-07 18:35:19 UTC
Created attachment 76286 [details]
xrandr log
Comment 2 Achim Bohnet 2013-01-07 18:37:35 UTC
Created attachment 76287 [details]
kscreen console log
Comment 3 Achim Bohnet 2013-01-07 19:43:26 UTC
@#$^^.  My fault.  My pkgs missed to install the KSC_* plugins of libkscreen.   Now kcm plugin starts and kded4 no longer crashes.

It's maybe a good idea to check if the plugin could be loaded/is loaded sucessfully, but on a properly installed system, the crash would not happen.

Sorry, for the false alarm.

Achim
Comment 4 Daniel Vrátil 2013-01-07 20:30:58 UTC
Reopening. Crashing when no module is install/fails to load is a bug. We should handle it and exit gracefully with an error message.
Comment 5 Daniel Vrátil 2013-01-07 21:21:31 UTC
Git commit c0935935046cd9fe8b10acb88bbddbf70767c8c7 by Dan Vrátil.
Committed on 07/01/2013 at 22:21.
Pushed by dvratil into branch 'master'.

Be more careful about null pointers

Check for null pointers before dereferencing (mostly in KDED).

M  +4    -0    kcm/src/displayconfiguration.cpp
M  +7    -0    kded/daemon.cpp
M  +17   -0    kded/generator.cpp
M  +14   -1    kded/serializer.cpp

http://commits.kde.org/kscreen/c0935935046cd9fe8b10acb88bbddbf70767c8c7