Bug 335366

Summary: Crash in configuration notification handling
Product: [Plasma] KScreen Reporter: Ralf Jung <post>
Component: kdedAssignee: Alex Fiestas <afiestas>
Status: RESOLVED FIXED    
Severity: crash CC: dvratil
Priority: NOR    
Version: 1.0.3   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 1.0.5
Sentry Crash Report:

Description Ralf Jung 2014-05-26 12:44:49 UTC
When there is a notification about the last screen being removed, the kded module often crashes. Also, I regularly see crashes of the plasma applet (tearing down the entire plasma) when I plug in a screen while the machine is in stand-by.

Reproducible: Sometimes

Steps to Reproduce:
1. On a laptop, connect an external screen and disable the internal one
2. Pull out the external monitor plug
Actual Results:  
The kded module crashes.

Expected Results:  
It shouldn't crash...

Here's a backtrace:

Application: KDE Daemon (kded4), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f7ded253780 (LWP 4094))]

Thread 2 (Thread 0x7f7dce8e7700 (LWP 4096)):
#0  0x00007f7decb9590d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f7de7f9ffe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f7de7fa00ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f7dea9de676 in QEventDispatcherGlib::processEvents (this=0x7f7dc80008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:427
#4  0x00007f7dea9affef in QEventLoop::processEvents (this=this@entry=0x7f7dce8e6e20, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f7dea9b02e5 in QEventLoop::exec (this=this@entry=0x7f7dce8e6e20, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f7dea8acbef in QThread::exec (this=this@entry=0x1807d50) at thread/qthread.cpp:538
#7  0x00007f7dea991763 in QInotifyFileSystemWatcherEngine::run (this=0x1807d50) at io/qfilesystemwatcher_inotify.cpp:265
#8  0x00007f7dea8af2bf in QThreadPrivate::start (arg=0x1807d50) at thread/qthread_unix.cpp:349
#9  0x00007f7de8480062 in start_thread (arg=0x7f7dce8e7700) at pthread_create.c:312
#10 0x00007f7decba0c1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7f7ded253780 (LWP 4094)):
[KCrash Handler]
#6  KScreen::Output::id (this=0x0) at /tmp/buildd/libkscreen-1.0.3/src/output.cpp:151
#7  0x00007f7dced02cb6 in XRandRConfig::toKScreenConfig (this=0x17cb970) at /tmp/buildd/libkscreen-1.0.3/backends/xrandr/xrandrconfig.cpp:128
#8  0x00007f7dcf352149 in Serializer::currentId () at /tmp/buildd/kscreen-1.0.2.1/kded/serializer.cpp:40
#9  0x00007f7dcf352672 in Serializer::configExists () at /tmp/buildd/kscreen-1.0.2.1/kded/serializer.cpp:61
#10 0x00007f7dcf351532 in KScreenDaemon::applyConfig (this=0x17d5280) at /tmp/buildd/kscreen-1.0.2.1/kded/daemon.cpp:93
#11 0x00007f7dea9c56aa in QMetaObject::activate (sender=sender@entry=0x1800370, m=m@entry=0x7f7dcf347b60 <KScreen::Output::staticMetaObject>, local_signal_index=local_signal_index@entry=4, argv=argv@entry=0x0) at kernel/qobject.cpp:3567
#12 0x00007f7dcf13f033 in KScreen::Output::isConnectedChanged (this=this@entry=0x1800370) at /tmp/buildd/libkscreen-1.0.3/obj-x86_64-linux-gnu/src/output.moc:274
#13 0x00007f7dcf13f053 in KScreen::Output::setConnected (this=this@entry=0x1800370, connected=<optimized out>) at /tmp/buildd/libkscreen-1.0.3/src/output.cpp:353
#14 0x00007f7dced0c318 in XRandROutput::updateKScreenOutput (this=this@entry=0x17d5460, output=0x1800370) at /tmp/buildd/libkscreen-1.0.3/backends/xrandr/xrandroutput.cpp:391
#15 0x00007f7dced02e4b in XRandRConfig::updateKScreenConfig (this=0x17cb970, config=0x18008c0) at /tmp/buildd/libkscreen-1.0.3/backends/xrandr/xrandrconfig.cpp:157
#16 0x00007f7dcf13df59 in KScreen::ConfigMonitor::Private::updateConfigs (this=0x1801760) at /tmp/buildd/libkscreen-1.0.3/src/configmonitor.cpp:46
#17 0x00007f7dcf13df8d in KScreen::ConfigMonitor::notifyUpdate (this=0x1800240) at /tmp/buildd/libkscreen-1.0.3/src/configmonitor.cpp:96
#18 0x00007f7dced00142 in XRandR::updateOutput (this=<optimized out>, output=67) at /tmp/buildd/libkscreen-1.0.3/backends/xrandr/xrandr.cpp:130
#19 0x00007f7dea9c56aa in QMetaObject::activate (sender=sender@entry=0x17e1720, m=m@entry=0x7f7dcef11980 <XRandRX11Helper::staticMetaObject>, local_signal_index=<optimized out>, argv=0x7fff5751e500) at kernel/qobject.cpp:3567
#20 0x00007f7dced0196b in outputChanged (_t1=<optimized out>, this=<optimized out>) at /tmp/buildd/libkscreen-1.0.3/obj-x86_64-linux-gnu/backends/xrandr/xrandrx11helper.moc:119
#21 XRandRX11Helper::x11Event (this=0x17e1720, event=0x7fff5751e600) at /tmp/buildd/libkscreen-1.0.3/backends/xrandr/xrandrx11helper.cpp:147
#22 0x00007f7dec37aa78 in publicX11Event (e=0x7fff5751e600, this=<optimized out>) at ../../kdeui/kernel/ksystemeventfilter.cpp:43
#23 KSystemEventFilterPrivate::filterEvent (this=0x17d5c00, message=0x7fff5751e600) at ../../kdeui/kernel/ksystemeventfilter.cpp:102
#24 0x00007f7dea9a329e in QAbstractEventDispatcher::filterEvent (this=0x0, message=0x19e72d0, message@entry=0x7fff5751e600) at kernel/qabstracteventdispatcher.cpp:542
#25 0x00007f7deb6cf640 in x11EventSourceDispatch (s=0x14cd120, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:143
#26 0x00007f7de7f9fe04 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007f7de7fa0048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007f7de7fa00ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007f7dea9de655 in QEventDispatcherGlib::processEvents (this=0x1494630, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#30 0x00007f7deb6cf7c6 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#31 0x00007f7dea9affef in QEventLoop::processEvents (this=this@entry=0x7fff5751e9d0, flags=...) at kernel/qeventloop.cpp:149
#32 0x00007f7dea9b02e5 in QEventLoop::exec (this=this@entry=0x7fff5751e9d0, flags=...) at kernel/qeventloop.cpp:204
#33 0x00007f7dea9b5ab9 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1225
#34 0x00007f7deb62fe8c in QApplication::exec () at kernel/qapplication.cpp:3828
#35 0x00007f7dece6fd0b in kdemain (argc=1, argv=0x7fff5751ec48) at ../../kded/kded.cpp:940
#36 0x00007f7decadcb45 in __libc_start_main (main=0x4006d0 <main(int, char**)>, argc=1, argv=0x7fff5751ec48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff5751ec38) at libc-start.c:287
#37 0x00000000004006fe in _start ()


I am using Debian testing amd64. libkscreen 1.0.3, kscreen 1.0.2.1.

I am sorry if this is a duplicate, DrKonqui wants to report this against kded and doesn't help - and I couldn't find duplicates on my own.
Comment 1 Daniel Vrátil 2014-06-28 09:09:17 UTC
Git commit 891fea508e1d1157ce6cd8ddc6005fc4b8f563fd by Dan Vrátil.
Committed on 28/06/2014 at 08:55.
Pushed by dvratil into branch 'master'.

Fix crash in XRandR backend when primary output is not set
Related: bug 334598
FIXED-IN: 1.0.5

M  +1    -1    backends/xrandr/xrandrconfig.cpp

http://commits.kde.org/libkscreen/891fea508e1d1157ce6cd8ddc6005fc4b8f563fd
Comment 2 Ralf Jung 2014-07-17 16:51:03 UTC
Is there any chance of a release with this fix? I am still experiencing it on a daily basis, and the fact that I know there's a patch somewhere doesn't make that more fun ;-) .
Please forgive me if a release already happened. I couldn't find a git tag or a "News" announcement in <https://projects.kde.org/projects/extragear/libs/libkscreen/news>, but that also applies to 1.0.4. So I don't know how to figure out what is the latest release.