Bug 317507 - KScreen crashes when pressing the "switch displays button"
Summary: KScreen crashes when pressing the "switch displays button"
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: KScreen
Classification: Plasma
Component: kded (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR grave
Target Milestone: 1.0
Assignee: Alex Fiestas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-28 21:18 UTC by Jens Rutschmann
Modified: 2013-06-13 17:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
debugging output during crash (32.70 KB, text/plain)
2013-05-02 21:15 UTC, Jens Rutschmann
Details
terminal output (47.12 KB, text/plain)
2013-05-31 15:57 UTC, Jens Rutschmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Rutschmann 2013-03-28 21:18:02 UTC
Application: kded4 ($Id$)
KDE Platform Version: 4.10.1 (Compiled from sources)
Qt Version: 4.8.4
Operating System: Linux 3.7.5 i686
Distribution (Platform): Gentoo Packages

-- Information about the crash:
I resumed my Laptop (Thinkpad T61, nvidia + binary driver) then installed the latest kscreen from git (Gentoo live ebuilds)
Then I stopped the original screen management and started kscreen using these commands as suggested by the ebuild:

jens:~> qdbus org.kde.kded /kded org.kde.kded.unloadModule randrmonitor
true
jens:~> qdbus org.kde.kded /kded org.kde.kded.setModuleAutoloading randrmonitor false

jens:~> qdbus org.kde.kded /kded org.kde.kded.loadModule kscreen
true
jens:~> qdbus org.kde.kded /kded org.kde.kded.setModuleAutoloading kscreen true

This immediated expanded the desktop to my external screen which was switched off at that time. My laptop screen went almost black and I saw only one titlebar of a maximized window. Clicking where the main panel should be switched windows as usual but the complete panel went black.

Then I pressed the 'switch displays' button (Fn+F7). This crashed kscreen, see attached backtrace.

The only way to get the panel back was blind-rightclicking on it, unlocking the widgets and changing the height of the panel. Probably this is not related to the crash though.

I'm using nvidia-drivers 313.26

The crash can be reproduced every time.

-- Backtrace:
Application: KDE-Dienst (kded4), signal: Segmentation fault
Using host libthread_db library "/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0xb548f740 (LWP 1813))]

Thread 2 (Thread 0xab61eb40 (LWP 1957)):
#0  0xb56f52fd in __GI_clock_gettime (clock_id=1, tp=0xab61ded8) at ../sysdeps/unix/clock_gettime.c:115
#1  0xb5faa495 in do_gettime (frac=0xab61ded0, sec=0xab61dec8) at tools/qelapsedtimer_unix.cpp:123
#2  qt_gettime () at tools/qelapsedtimer_unix.cpp:140
#3  0xb60987b6 in QTimerInfoList::updateCurrentTime (this=0x93d4b9c) at kernel/qeventdispatcher_unix.cpp:354
#4  0xb6098b1a in QTimerInfoList::timerWait (this=0x93d4b9c, tm=...) at kernel/qeventdispatcher_unix.cpp:461
#5  0xb6097283 in timerSourcePrepareHelper (src=<optimized out>, timeout=0xab61dfec) at kernel/qeventdispatcher_glib.cpp:136
#6  0xb6097325 in timerSourcePrepare (source=0x93d4b68, timeout=<optimized out>) at kernel/qeventdispatcher_glib.cpp:169
#7  0xb5914de8 in g_main_context_prepare (context=0x92a44d0, priority=0xab61e048) at gmain.c:2986
#8  0xb59154df in g_main_context_iterate (dispatch=1, block=1, context=0x92a44d0, self=<optimized out>) at gmain.c:3270
#9  g_main_context_iterate (context=0x92a44d0, block=1, dispatch=1, self=<optimized out>) at gmain.c:3227
#10 0xb5915731 in g_main_context_iteration (context=0x92a44d0, may_block=1) at gmain.c:3351
#11 0xb6097d4f in QEventDispatcherGlib::processEvents (this=0x937e980, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#12 0xb606341d in QEventLoop::processEvents (this=0xab61e170, flags=...) at kernel/qeventloop.cpp:149
#13 0xb60636b9 in QEventLoop::exec (this=0xab61e170, flags=...) at kernel/qeventloop.cpp:204
#14 0xb5f47fdc in QThread::exec (this=0x92ebf60) at thread/qthread.cpp:542
#15 0xb60402bd in QInotifyFileSystemWatcherEngine::run (this=0x92ebf60) at io/qfilesystemwatcher_inotify.cpp:256
#16 0xb5f4b528 in QThreadPrivate::start (arg=0x92ebf60) at thread/qthread_unix.cpp:338
#17 0xaf403e81 in ?? () from /usr/lib/libGL.so.1
#18 0x5c8b0824 in ?? ()
#19 0xbab80424 in ?? ()
#20 0x65000000 in ?? ()
#21 0x001015ff in ?? ()
#22 0xd3890000 in ?? ()
#23 0xfff0013d in ?? ()
#24 0xc30173ff in ?? ()
#25 0x0f9882e8 in ?? ()
#26 0xbbc18100 in ?? ()
#27 0x8b00174d in ?? ()
#28 0xffff0489 in ?? ()
#29 0x65d8f7ff in ?? ()
#30 0xc8830189 in ?? ()
#31 0x9066c3ff in ?? ()
#32 0x90669066 in ?? ()
#33 0x00acec81 in ?? ()
#34 0x9c890000 in ?? ()
#35 0x0000a024 in ?? ()
#36 0x9851e800 in ?? ()
#37 0xc381000f in ?? ()
#38 0x00174d8e in ?? ()
#39 0xa424b489 in ?? ()
#40 0x8b000000 in ?? ()
#41 0x00b024b4 in ?? ()
#42 0xbc890000 in ?? ()
#43 0x0000a824 in ?? ()
#44 0x247c8d00 in ?? ()
#45 0x247c8914 in ?? ()
#46 0x2444c708 in ?? ()
#47 0x00000004 in ?? ()
#48 0x24348900 in ?? ()
#49 0xfff88be8 in ?? ()
#50 0x78c085ff in ?? ()
#51 0xff4e8d7f in ?? ()
#52 0x000001b8 in ?? ()
#53 0xd3ca8900 in ?? ()
#54 0x248c8be0 in ?? ()
#55 0x000000b4 in ?? ()
#56 0x8505eac1 in ?? ()
#57 0x814d75c9 in ?? ()
#58 0x0098248c in ?? ()
#59 0x00000000 in ?? ()

Thread 1 (Thread 0xb548f740 (LWP 1813)):
[KCrash Handler]
#7  0xa586ee18 in KScreen::Mode::id() const () from /usr/lib/libkscreen.so.0
#8  0xa58ac390 in ?? () from /usr/lib/kde4/kded_kscreen.so
#9  0xa58a3c4e in KScreenDaemon::applyGenericConfig() () from /usr/lib/kde4/kded_kscreen.so
#10 0xa58a1d68 in ?? () from /usr/lib/kde4/kded_kscreen.so
#11 0xb607b7f1 in QMetaObject::activate (sender=0x95fd328, m=0xb61ca4d8 <QTimer::staticMetaObject>, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3539
#12 0xb60cf595 in QTimer::timeout (this=0x95fd328) at .moc/release-shared/moc_qtimer.cpp:148
#13 0xb6084866 in QTimer::timerEvent (this=0x95fd328, e=0xbf93e7bc) at kernel/qtimer.cpp:280
#14 0xb607fdc4 in QObject::event (this=0x95fd328, e=0xbf93e7bc) at kernel/qobject.cpp:1156
#15 0xb668e2f4 in notify_helper (e=0xbf93e7bc, receiver=0x95fd328, this=0x9196d20) at kernel/qapplication.cpp:4562
#16 QApplicationPrivate::notify_helper (this=0x9196d20, receiver=0x95fd328, e=0xbf93e7bc) at kernel/qapplication.cpp:4534
#17 0xb669375a in QApplication::notify (this=0xbf93e7bc, receiver=0x95fd328, e=0xbf93e7bc) at kernel/qapplication.cpp:4291
#18 0xb720a921 in KApplication::notify (this=0xbf93eac0, receiver=0x95fd328, event=0xbf93e7bc) at /tmp/portage/kde-base/kdelibs-4.10.1/work/kdelibs-4.10.1/kdeui/kernel/kapplication.cpp:311
#19 0xb6064b9e in QCoreApplication::notifyInternal (this=0xbf93eac0, receiver=0x95fd328, event=0xbf93e7bc) at kernel/qcoreapplication.cpp:946
#20 0xb6099fa8 in sendEvent (event=0xbf93e7bc, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#21 QTimerInfoList::activateTimers (this=0x9198bbc) at kernel/qeventdispatcher_unix.cpp:622
#22 0xb6097558 in timerSourceDispatch (source=0x9198b88) at kernel/qeventdispatcher_glib.cpp:186
#23 timerSourceDispatch (source=0x9198b88) at kernel/qeventdispatcher_glib.cpp:180
#24 0xb59152b6 in g_main_dispatch (context=0x9198000) at gmain.c:2715
#25 g_main_context_dispatch (context=0x9198000) at gmain.c:3219
#26 0xb5915658 in g_main_context_iterate (dispatch=1, block=-1248709648, context=0x9198000, self=<optimized out>) at gmain.c:3290
#27 g_main_context_iterate (context=0x9198000, block=-1248709648, dispatch=1, self=<optimized out>) at gmain.c:3227
#28 0xb5915731 in g_main_context_iteration (context=0x9198000, may_block=1) at gmain.c:3351
#29 0xb6097ce7 in QEventDispatcherGlib::processEvents (this=0x9196ce0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#30 0xb67423fa in QGuiEventDispatcherGlib::processEvents (this=0x9196ce0, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#31 0xb606341d in QEventLoop::processEvents (this=0xbf93ea24, flags=...) at kernel/qeventloop.cpp:149
#32 0xb60636b9 in QEventLoop::exec (this=0xbf93ea24, flags=...) at kernel/qeventloop.cpp:204
#33 0xb6068caa in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#34 0xb668c234 in QApplication::exec () at kernel/qapplication.cpp:3823
#35 0xb7757fe9 in kdemain (argc=1, argv=0xbf93ecd4) at /tmp/portage/kde-base/kdelibs-4.10.1/work/kdelibs-4.10.1/kded/kded.cpp:924
#36 0x0804857b in main (argc=1, argv=0xbf93ecd4) at /tmp/portage/kde-base/kdelibs-4.10.1/work/kdelibs-4.10.1_build/kded/kded4_dummy.cpp:3


Reproducible: Always
Comment 1 Alex Fiestas 2013-03-29 10:58:14 UTC
Can you try with KScreen 0.1 RC1 ? I'm pretty sure we fixed this issue already.

thanks !
Comment 2 Jens Rutschmann 2013-03-29 13:10:53 UTC
Hi Alex,

I did the following:
- uninstalled live git versions of kscreen & libkscreen
- installed 0.0.81
- setup loading using the dbus commands
- reboot machine (monitor unplugged)
- deleted user kscreen config files on VT
- logged in to KDE
- opened system settings -> kscreen is loading automatically
- plugged in monitor -> nothing happened
- press XF86Display -> nothing happened
- in Konsole launched "kscreen-console outputs" -> ext monitor is switched on, desktop expands
- pressed XF86Display -> crash, same backtrace for the crashing thread as above.


Seems there are two separate issues here:
1) the crash when pressing XF86Display
2) Missing plugging events. Are those supposed to work with the nvidia binary driver at all?
Comment 3 Jens Rutschmann 2013-03-29 13:13:14 UTC
One more thing wrt. to plugging events:

I kept "kscreen-console monitor" running in Konsole and there was nothing printed when plugging in / out the monitor. I suspect this should actually output something.
Comment 4 Daniel Vrátil 2013-03-31 14:12:53 UTC
(in reply to comment #2)
> 2) Missing plugging events. Are those supposed to work with the nvidia binary driver at all?

(In reply to comment #3)
> One more thing wrt. to plugging events:
> 
> I kept "kscreen-console monitor" running in Konsole and there was nothing
> printed when plugging in / out the monitor. I suspect this should actually
> output something.

Works for me usually. On rare occasions it's necessary to run "xrandr" from another terminal manually to force X server to request current configuration from drivers. Or restart kscreen-console (we do the same query for current config as xrandr on startup).
Comment 5 Alex 2013-04-09 13:42:01 UTC
I have another problem with kded4, but looks like it's sooner of all related to this one. 
- almost same setup: kde 4.10.1 build from sources using gentoo packages
- same utility causes problem at kde startup, but I get malloc() error from glibc instead segfault

~/.xsession-errors contains the following:
startkde: Starting up...
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
kbuildsycoca4 running...
kbuildsycoca4(30001) KBuildSycoca::checkTimestamps: checking file timestamps
kbuildsycoca4(30001) KBuildSycoca::checkTimestamps: timestamps check ok
kbuildsycoca4(30001) kdemain: Emitting notifyDatabaseChanged ()
*** glibc detected *** kdeinit4: kded4 [kdeinit]: malloc(): memory corruption: 0x00000000013ccf10 ***
Comment 6 Alex Fiestas 2013-04-25 14:58:23 UTC
We are going to need more feedback to fix this, please provide the following:

-execute kdebugdialog and enable: kded, kscreen, ksrandr
-kquitapp kded
-kded4 
-Reproduce the crash

In the output you shoudl see text containing the word KSrandr, if you don't see it try to logout/login.

Thanks !
Comment 7 Jens Rutschmann 2013-05-02 21:15:34 UTC
Created attachment 79646 [details]
debugging output during crash

As requested I've reproduced the crash with debugging turned on. 

I've attached the konsole history (with a lot of output from networkmanagement, kio and kmix removed).

Let me know if you need anything else. Btw. in kdebugdialog there was no 'kscreen' entry, just 'kscreen-console', so I've enabled that one.

The log should show traces from me pressing the switch displays button directly after enabling kscreen - without crashing (multiple times, there was no visible reaction). 

The crash could be reproduced after I suspended and resumed and then pressed the button again (search for 'UPowerSuspendJob')

Thanks for looking into this,
Jens
Comment 8 Alex Fiestas 2013-05-10 17:30:02 UTC
Is it possible that you are docking your laptop?

Can you please attach the output of:
kscreen-console bug

with each of your setup?

Thanks
Comment 9 Jens Rutschmann 2013-05-31 15:57:01 UTC
Created attachment 80220 [details]
terminal output

Hi Alex,

attached is the full output from konsole, below are the commands i've executed for a short overview.

I could no longer reliably reproduce the crash, but I've update kernel to 3.9.4 and nvidia-drivers to 319.23 in the meantime. The black screen error no longer appears as well.

Concerning kscreen functionality, there were only visible changes when i launched "kscreen-konsole bug". There was no reaction at all when plugging in the vga connector.

Hope this helps anyway, let me know if you need more info.

--------------------------------------------------------------------

echo currently the external vga display is NOT attached

echo these kded modules are loaded right now:
qdbus org.kde.kded /kded org.kde.kded.loadedModules

echo now i am startin kscreen
qdbus org.kde.kded /kded org.kde.kded.loadModule kscreen

echo the laptop screen is working as usual, deskop is not expanded
kscreen-console bug

echo nothing changed so far, now i am attachting the external vga display

echo external display is attached, no visible change so far

kscreen-console bug

echo now the external display is switched on and the desktop is expanded and displayed correctly

kscreen-console bug

echo now i am detaching the external display again

echo display is detached, half of desktop is displayed on internal display, desktop is still expanded

kscreen-console bug

echo desktop is now resized to the internal display

echo attaching external screen again

echo as before, no change in desktop, external display still switched off

echo these kded modules are loaded right now:
qdbus org.kde.kded /kded org.kde.kded.loadedModules

echo now i will try the Fn+F7 hotkey

echo nothing happened, trying  a few times more ...

echo  nothing changed

xev

(killed xev using mouse)

kscreen-console bug

echo now external display is on, desktop expanded

echo after hitting Fn+F7 a few times it started to work, WTF ....
echo i using the button i can now cycle between internal-only, internal-clones-external (with the bigger resoultion of the ext.) and external-only

echo now only internal display is active, suspending ...

echo resumed ...

echo still only the internal display is active

echo pressing button again ...

echo -> cloned output

echo these kded modules are loaded right now:
qdbus org.kde.kded /kded org.kde.kded.loadedModules

echo seems something restarted kded ... maybe suspend ?
Comment 10 Alex Fiestas 2013-06-13 17:16:50 UTC
I'm 99% certain we fixed this bug in 46033acb774327e4b12ff182a314ce4ba9031b4d released with the latest RC.

If you can reproduce the crash while using version 0.0.92 please feel free to reopen the bug. 

Thanks !