Bug 333277 - kded4 segfaults when session started from command
Summary: kded4 segfaults when session started from command
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: kded (show other bugs)
Version: 1.0.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Daniel Vrátil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-10 14:21 UTC by Glenn Holmer
Modified: 2015-03-06 14:01 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.2.3


Attachments
backtrace (3.40 KB, text/plain)
2014-04-10 14:21 UTC, Glenn Holmer
Details
My backtrace (5.61 KB, text/plain)
2014-06-05 07:24 UTC, Jos Huisken
Details
Xrandr11 Fix for libkscreen which size is not defined due to remote login (1.08 KB, text/plain)
2014-11-30 16:17 UTC, Franz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Glenn Holmer 2014-04-10 14:21:00 UTC
kded4 crashes when a KDE session is started from VNC.

Reproducible: Always

Steps to Reproduce:
1. start VNC as follows

su $USER1 -l -s /bin/bash -c \
"vncserver :1 -geometry 1024x768 -depth 24 -name $SESSION_NAME" 2>&1

where $USER1 is the name of a user and $SESSION_NAME is the hostname of the VM with "1" or "2" appended.

~/.vnc/xstartup contains just the single line:

. /etc/X11/Xsession

(tried also with "startkde")
Actual Results:  
Session starts and can be connected to via VNC, but there is a crash dialog on the screen.

Expected Results:  
Session should start normally without kded4 segfaulting.

Will attach backtrace.
Comment 1 Glenn Holmer 2014-04-10 14:21:39 UTC
Created attachment 86032 [details]
backtrace
Comment 2 Christoph Feck 2014-04-10 18:28:46 UTC
Application: KDE Daemon (kded4), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[KCrash Handler]
#5  0x00007f3efe0e00d6 in ?? () from /usr/lib/kde4/plugins/kscreen/KSC_XRandR11.so
#6  0x00007f3efe7207b5 in KScreenDaemon::monitorConnectedChange() () from /usr/lib/kde4/kded_kscreen.so
#7  0x00007f3efe720e5f in KScreenDaemon::KScreenDaemon(QObject*, QList<QVariant> const&) () from /usr/lib/kde4/kded_kscreen.so
#8  0x00007f3efe721968 in ?? () from /usr/lib/kde4/kded_kscreen.so
#9  0x00007f3f1aba1483 in KPluginFactory::create(char const*, QWidget*, QObject*, QList<QVariant> const&, QString const&) () from /usr/lib/libkdecore.so.5
#10 0x00007f3f04e51d3a in ?? () from /usr/lib/kde4/libkdeinit/libkdeinit4_kded4.so
#11 0x00007f3f04e52561 in ?? () from /usr/lib/kde4/libkdeinit/libkdeinit4_kded4.so
#12 0x00007f3f04e52d18 in ?? () from /usr/lib/kde4/libkdeinit/libkdeinit4_kded4.so
#13 0x00007f3f04e52d83 in ?? () from /usr/lib/kde4/libkdeinit/libkdeinit4_kded4.so
#14 0x00007f3f04e5525d in ?? () from /usr/lib/kde4/libkdeinit/libkdeinit4_kded4.so
#15 0x00007f3f1b3c1dfa in ?? () from /usr/lib/libkdeui.so.5
#16 0x00007f3f1b3c1e75 in ?? () from /usr/lib/libkdeui.so.5
#17 0x00007f3f1b3c2093 in ?? () from /usr/lib/libkdeui.so.5
#18 0x00007f3f179bd1f6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#19 0x00007f3f179be2f9 in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#20 0x00007f3f179beddd in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#21 0x00007f3f179beeab in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#22 0x00007f3f1a653c1e in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#23 0x00007f3f199d9ed3 in QApplication::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#24 0x00007f3f199d4e2c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#25 0x00007f3f199db4a0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#26 0x00007f3f1b3babaa in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#27 0x00007f3f1a63b4dd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#28 0x00007f3f1a63eb3d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#29 0x00007f3f1a668f83 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#30 0x00007f3f1632ce04 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007f3f1632d048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007f3f1632d0ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007f3f1a6687a1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#34 0x00007f3f19a76bb6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#35 0x00007f3f1a63a0af in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#36 0x00007f3f1a63a3a5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#37 0x00007f3f1a63fb79 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#38 0x00007f3f04e53d1b in kdemain () from /usr/lib/kde4/libkdeinit/libkdeinit4_kded4.so
#39 0x00000000004083ee in _start ()
Comment 3 Matthew Hall 2014-04-25 01:11:01 UTC
It's happening on my system as well. Can someone marked it Confirmed and give us a hand? I don't know anything much about this part of the code.

Thanks,
Matthew.

#5  0x00007f1518a310d6 in ?? () from /usr/lib/kde4/plugins/kscreen/KSC_XRandR11.so
#6  0x00007f15190717b5 in KScreenDaemon::monitorConnectedChange() () from /usr/lib/kde4/kded_kscreen.so
#7  0x00007f1519071e5f in KScreenDaemon::KScreenDaemon(QObject*, QList<QVariant> const&) () from /usr/lib/kde4/kded_kscreen.so
#8  0x00007f1519072968 in ?? () from /usr/lib/kde4/kded_kscreen.so
#9  0x00007f15354eb383 in KPluginFactory::create(char const*, QWidget*, QObject*, QList<QVariant> const&, QString const&) () from /usr/lib/libkdecore.so.5
#10 0x00007f151f79bd3a in ?? () from /usr/lib/kde4/libkdeinit/libkdeinit4_kded4.so
#11 0x00007f151f79c561 in ?? () from /usr/lib/kde4/libkdeinit/libkdeinit4_kded4.so
#12 0x00007f151f79cd18 in ?? () from /usr/lib/kde4/libkdeinit/libkdeinit4_kded4.so
#13 0x00007f151f79cd83 in ?? () from /usr/lib/kde4/libkdeinit/libkdeinit4_kded4.so
#14 0x00007f151f79f25d in ?? () from /usr/lib/kde4/libkdeinit/libkdeinit4_kded4.so
#15 0x00007f1535d0bdfa in ?? () from /usr/lib/libkdeui.so.5
#16 0x00007f1535d0be75 in ?? () from /usr/lib/libkdeui.so.5
#17 0x00007f1535d0c093 in ?? () from /usr/lib/libkdeui.so.5
#18 0x00007f15323071f6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#19 0x00007f15323082f9 in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#20 0x00007f1532308ddd in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#21 0x00007f1532308eab in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#22 0x00007f1534f9dc1e in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#23 0x00007f1534323ed3 in QApplication::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#24 0x00007f153431ee2c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#25 0x00007f15343254a0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#26 0x00007f1535d04baa in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#27 0x00007f1534f854dd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#28 0x00007f1534f88b3d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#29 0x00007f1534fb2f83 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#30 0x00007f1530c76e04 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007f1530c77048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007f1530c770ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007f1534fb27a1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#34 0x00007f15343c0bb6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#35 0x00007f1534f840af in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#36 0x00007f1534f843a5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#37 0x00007f1534f89b79 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#38 0x00007f151f79dd1b in kdemain () from /usr/lib/kde4/libkdeinit/libkdeinit4_kded4.so
#39 0x00000000004083ee in _start ()
Comment 4 Jos Huisken 2014-06-05 07:24:21 UTC
Created attachment 87020 [details]
My backtrace

I can confirm this bug as well.

I start vncserver with display :7 remotely in an SSH session as a normal user. Tunneling the remote vnc port to local.
No other users are logged in, so only the login screen session is running on the console on display :0.
Comment 5 Franz 2014-11-30 16:16:22 UTC
Hi,
i can copy the problem as well. (4.14.2)
Doing this: installing xrdp on the client.
Connecting via rdp client and login.
kded4 segfaults.

I compiled kdelibs, kscreen and libkscreen using cmake debugging release and flags.
kded4 fails in setting the min and maxwidth on change, which it wants to get from "size".
size is undefined when coming from remote. I didn't dig deeper, but attached you'll find a testpatch. Has to be applied to libkscreen 1.0.5.
Hope, someone find this patch usefull. I debuged some hours though ;-)

Rgds.

Franz

My solution, after debugging:
Comment 6 Franz 2014-11-30 16:17:16 UTC
Created attachment 89783 [details]
Xrandr11 Fix for libkscreen which size is not defined due to remote login
Comment 7 Daniel Vrátil 2015-03-06 14:01:05 UTC
Git commit 1adcb4a3324959ea9be1fcdad318dafba4a3ffcc by Dan Vrátil.
Committed on 06/03/2015 at 13:59.
Pushed by dvratil into branch 'Plasma/5.2'.

XRandR1.1: Fix crash when connected through RDP

Thanks to Franz for the patch.
FIXED-iN: 5.2.3

M  +7    -2    backends/xrandr1.1/xrandr11.cpp

http://commits.kde.org/libkscreen/1adcb4a3324959ea9be1fcdad318dafba4a3ffcc