Bug 324625 - kscreen crashes kde daemon
Summary: kscreen crashes kde daemon
Status: CLOSED FIXED
Alias: None
Product: KScreen
Classification: Unclassified
Component: libkscreen (show other bugs)
Version: 1.0.1
Platform: openSUSE RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Alex Fiestas
URL:
Keywords: drkonqi
: 323274 324542 325900 327716 327965 327966 334139 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-07 17:50 UTC by Jiri Slaby
Modified: 2018-07-12 20:42 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.0.2


Attachments
kscreen-console bug (16.97 KB, text/plain)
2013-09-09 11:44 UTC, Jiri Slaby
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Slaby 2013-09-07 17:50:25 UTC
Application: kded4 (4.11.1)
KDE Platform Version: 4.11.1
Qt Version: 4.8.5
Operating System: Linux 3.11.0-1-desktop x86_64
Distribution: "openSUSE 12.3 (x86_64)"

-- Information about the crash:
- What I was doing when the application crashed:
I have just updated to KDE 4.11.1. At every start, kde daemon crashes. I removed libkscreen libkscreen1 kscreen packages and it is OK now.

The crash can be reproduced every time.

-- Backtrace:
Application: KDE démon (kded4), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f41dc668780 (LWP 5107))]

Thread 2 (Thread 0x7f41bc501700 (LWP 5115)):
#0  0x00007f41d6c2c0e9 in ?? () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f41d6c2c329 in g_mutex_lock () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f41d6bec3f5 in g_main_context_prepare () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f41d6becd1e in ?? () from /usr/lib64/libglib-2.0.so.0
#4  0x00007f41d6becf24 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#5  0x00007f41db2f75d6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#6  0x00007f41db2c7bef in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#7  0x00007f41db2c7e78 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#8  0x00007f41db1ca110 in QThread::exec() () from /usr/lib64/libQtCore.so.4
#9  0x00007f41db2a83af in ?? () from /usr/lib64/libQtCore.so.4
#10 0x00007f41db1cd0ec in ?? () from /usr/lib64/libQtCore.so.4
#11 0x00007f41daf36e0f in start_thread (arg=0x7f41bc501700) at pthread_create.c:308
#12 0x00007f41d9cac7dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 1 (Thread 0x7f41dc668780 (LWP 5107)):
[KCrash Handler]
#6  XRandRMode::size (this=0x0) at /usr/src/debug/libkscreen-1.0.1/backends/xrandr/xrandrmode.cpp:53
#7  0x00007f41bd239cdf in XRandRConfig::applyKScreenConfig (this=0x166e760, config=0x182d1c0) at /usr/src/debug/libkscreen-1.0.1/backends/xrandr/xrandrconfig.cpp:168
#8  0x00007f41bd673a95 in KScreen::Config::setConfig (config=0x182d1c0) at /usr/src/debug/libkscreen-1.0.1/src/config.cpp:66
#9  0x00007f41bd8ae952 in KScreenDaemon::applyKnownConfig() () from /usr/lib64/kde4/kded_kscreen.so
#10 0x00007f41bd8aeafd in KScreenDaemon::applyConfig() () from /usr/lib64/kde4/kded_kscreen.so
#11 0x00007f41db2de44f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#12 0x00007f41db2de44f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#13 0x00007f41bd8b728a in ?? () from /usr/lib64/kde4/kded_kscreen.so
#14 0x00007f41db2de44f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#15 0x00007f41d808980f in QDBusPendingCallWatcher::finished(QDBusPendingCallWatcher*) () from /usr/lib64/libQtDBus.so.4
#16 0x00007f41db2dd92e in QObject::event(QEvent*) () from /usr/lib64/libQtCore.so.4
#17 0x00007f41da45592c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#18 0x00007f41da459dab in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#19 0x00007f41dc068f76 in KApplication::notify (this=0x7fff98c96760, receiver=0x19c64b0, event=0x19b7fe0) at /usr/src/debug/kdelibs-4.11.1/kdeui/kernel/kapplication.cpp:311
#20 0x00007f41db2c8f3e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4
#21 0x00007f41db2cc8a1 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/libQtCore.so.4
#22 0x00007f41db2f7423 in ?? () from /usr/lib64/libQtCore.so.4
#23 0x00007f41d6becb25 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#24 0x00007f41d6bece68 in ?? () from /usr/lib64/libglib-2.0.so.0
#25 0x00007f41d6becf24 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#26 0x00007f41db2f75b6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#27 0x00007f41da4f5e0e in ?? () from /usr/lib64/libQtGui.so.4
#28 0x00007f41db2c7bef in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#29 0x00007f41db2c7e78 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#30 0x00007f41db2ccbb8 in QCoreApplication::exec() () from /usr/lib64/libQtCore.so.4
#31 0x00007f41c3b2ba50 in kdemain () from /usr/lib64/libkdeinit4_kded4.so
#32 0x000000000040889a in _start ()

Reported using DrKonqi
Comment 1 Jiri Slaby 2013-09-07 18:06:15 UTC
If I had asserts enabled, I would hit this perhaps:
        Q_ASSERT_X(currentMode, "applyKScreenConfig", "currentOutput has returned a null XRandRMode*");

Now building with (however it is incorrect):
--- a/backends/xrandr/xrandrconfig.cpp
+++ b/backends/xrandr/xrandrconfig.cpp
@@ -165,6 +165,9 @@ void XRandRConfig::applyKScreenConfig(KS
         XRandRMode* currentMode = currentOutput->currentMode();
         Q_ASSERT_X(currentMode, "applyKScreenConfig", "currentOutput has returned a null XRandRMode*");
 
+       if (!currentMode)
+               continue;
+
         QSize size = currentMode->size();
 
         int x, y;
Comment 2 Jiri Slaby 2013-09-07 18:10:30 UTC
(In reply to comment #1)
> Now building with (however it is incorrect):

Yup, it allows me to work again...
Comment 3 Daniel Vrátil 2013-09-09 11:30:04 UTC
*** Bug 323274 has been marked as a duplicate of this bug. ***
Comment 4 Daniel Vrátil 2013-09-09 11:30:31 UTC
*** Bug 324542 has been marked as a duplicate of this bug. ***
Comment 5 Daniel Vrátil 2013-09-09 11:36:43 UTC
Can you please provide output from "kscreen-console bug" ?
Comment 6 Jiri Slaby 2013-09-09 11:44:30 UTC
Created attachment 82235 [details]
kscreen-console bug

(In reply to comment #5)
> Can you please provide output from "kscreen-console bug" ?

Is it enough from the fixed setup?
Comment 7 Jiri Slaby 2013-09-09 11:45:02 UTC
.
Comment 8 Daniel Vrátil 2013-09-09 16:44:06 UTC
Git commit 1d9ac012e857036bb8814cc84c9cf10bb57ca40c by Dan Vrátil.
Committed on 09/09/2013 at 16:43.
Pushed by dvratil into branch 'master'.

Refresh modes when currentModeId points to unknown mode

Sometimes drivers insert or remove modes, so when currentModeId points to a mode
that we don't have cached, we must refresh the local cache.

This also fixes a crash that occured when currentModeId would be pointing to a
mode that we don't have (even after refreshing modes)

REVIEW: 112604
Related: bug 323107
FIXED-IN: 1.0.2

M  +43   -20   backends/xrandr/xrandrconfig.cpp
M  +15   -0    backends/xrandr/xrandrmode.cpp
M  +4    -0    backends/xrandr/xrandrmode.h
M  +5    -0    backends/xrandr/xrandroutput.cpp
M  +3    -1    backends/xrandr/xrandroutput.h

http://commits.kde.org/libkscreen/1d9ac012e857036bb8814cc84c9cf10bb57ca40c
Comment 9 Jekyll Wu 2013-11-22 04:27:37 UTC
*** Bug 327716 has been marked as a duplicate of this bug. ***
Comment 10 Jekyll Wu 2013-11-22 04:28:56 UTC
*** Bug 325900 has been marked as a duplicate of this bug. ***
Comment 11 Jekyll Wu 2013-11-23 08:50:20 UTC
*** Bug 327965 has been marked as a duplicate of this bug. ***
Comment 12 Jekyll Wu 2013-11-23 08:52:03 UTC
*** Bug 327966 has been marked as a duplicate of this bug. ***
Comment 13 Jekyll Wu 2014-05-04 03:50:26 UTC
*** Bug 334139 has been marked as a duplicate of this bug. ***