Bug 346590

Summary: ShellCorona::reconsiderOutput crashes on first boot
Product: [Plasma] plasmashell Reporter: Jason Bradley Smith <jbssrepairs>
Component: generalAssignee: Sebastian Kügler <sebas>
Status: RESOLVED FIXED    
Severity: crash CC: bhush94, don.waterloo+kde, nadavkav, plasma-bugs, sebas
Priority: NOR Keywords: drkonqi
Version: 5.2.2   
Target Milestone: 1.0   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 5.3.1
Sentry Crash Report:

Description Jason Bradley Smith 2015-04-24 19:44:14 UTC
Application: plasmashell (5.2.2)

Qt Version: 5.4.1
Operating System: Linux 3.19.0-15-generic x86_64
Distribution: Ubuntu 15.04

-- Information about the crash:
- What I was doing when the application crashed:
-- Fresh install. Waiting for first boot.
- Unusual behavior I noticed:
-- Initial startup seemed slow. Picture on screen shrank to about 2/3 the size of the actual screen (1920x1080) and then after approximately 10-12 seconds, it went back to the full size fo the screen. It was like that for maybe 5 more seconds before crashing. Plasma-Desktop then restarted and the bug report popped up.

-- Backtrace:
Application: Plasma (plasmashell), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f619a3997c0 (LWP 1482))]

Thread 12 (Thread 0x7f6186112700 (LWP 1484)):
#0  0x00007f61951438dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f61976b0b72 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007f61976b264f in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007f6188459099 in QXcbEventReader::run (this=0xdfe270) at qxcbconnection.cpp:1105
#4  0x00007f61957c4b0e in QThreadPrivate::start (arg=0xdfe270) at thread/qthread_unix.cpp:337
#5  0x00007f61949ca6aa in start_thread (arg=0x7f6186112700) at pthread_create.c:333
#6  0x00007f619514eeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 11 (Thread 0x7f617f5f5700 (LWP 1504)):
#0  0x00007f6191894789 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007f619184f8cc in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f619184fe60 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f619184ffcc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f6195a5bc6c in QEventDispatcherGlib::processEvents (this=0x7f61700008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#5  0x00007f6195a003e2 in QEventLoop::exec (this=this@entry=0x7f617f5f4de0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f61957bfb44 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#7  0x00007f619754df65 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#8  0x00007f61957c4b0e in QThreadPrivate::start (arg=0xec15b0) at thread/qthread_unix.cpp:337
#9  0x00007f61949ca6aa in start_thread (arg=0x7f617f5f5700) at pthread_create.c:333
#10 0x00007f619514eeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 10 (Thread 0x7f61759a4700 (LWP 1505)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f617cad4e83 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#2  0x00007f617cad46e7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#3  0x00007f61949ca6aa in start_thread (arg=0x7f61759a4700) at pthread_create.c:333
#4  0x00007f619514eeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 9 (Thread 0x7f61751a3700 (LWP 1506)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f617cad4e83 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#2  0x00007f617cad46e7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#3  0x00007f61949ca6aa in start_thread (arg=0x7f61751a3700) at pthread_create.c:333
#4  0x00007f619514eeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 8 (Thread 0x7f61749a2700 (LWP 1507)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f617cad4e83 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#2  0x00007f617cad46e7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#3  0x00007f61949ca6aa in start_thread (arg=0x7f61749a2700) at pthread_create.c:333
#4  0x00007f619514eeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 7 (Thread 0x7f616ffff700 (LWP 1508)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f617cad4e83 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#2  0x00007f617cad46e7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#3  0x00007f61949ca6aa in start_thread (arg=0x7f616ffff700) at pthread_create.c:333
#4  0x00007f619514eeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 6 (Thread 0x7f616f7fe700 (LWP 1509)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f617cad4e83 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#2  0x00007f617cad46e7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#3  0x00007f61949ca6aa in start_thread (arg=0x7f616f7fe700) at pthread_create.c:333
#4  0x00007f619514eeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7f616effd700 (LWP 1510)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f617cad4e83 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#2  0x00007f617cad46e7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#3  0x00007f61949ca6aa in start_thread (arg=0x7f616effd700) at pthread_create.c:333
#4  0x00007f619514eeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7f616e7fc700 (LWP 1511)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f617cad4e83 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#2  0x00007f617cad46e7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#3  0x00007f61949ca6aa in start_thread (arg=0x7f616e7fc700) at pthread_create.c:333
#4  0x00007f619514eeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7f616dffb700 (LWP 1512)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f617cad4e83 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#2  0x00007f617cad46e7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#3  0x00007f61949ca6aa in start_thread (arg=0x7f616dffb700) at pthread_create.c:333
#4  0x00007f619514eeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7f61699e8700 (LWP 1513)):
#0  0x00007f6191894789 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007f619184fdbd in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f619184ffcc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6195a5bc6c in QEventDispatcherGlib::processEvents (this=0x7f61640008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#4  0x00007f6195a003e2 in QEventLoop::exec (this=this@entry=0x7f61699e7de0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#5  0x00007f61957bfb44 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#6  0x00007f619754df65 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#7  0x00007f61957c4b0e in QThreadPrivate::start (arg=0xea4470) at thread/qthread_unix.cpp:337
#8  0x00007f61949ca6aa in start_thread (arg=0x7f61699e8700) at pthread_create.c:333
#9  0x00007f619514eeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7f619a3997c0 (LWP 1482)):
[KCrash Handler]
#6  KScreen::Config::connectedOutputs (this=0x0) at ../../src/config.cpp:196
#7  0x00000000004535c5 in ShellCorona::reconsiderOutputs (this=0xeb1f00) at ../../shell/shellcorona.cpp:778
#8  0x00007f6195a3335a in call (a=0x7ffe66599360, r=0xeb1f00, this=0xec0510) at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:124
#9  QMetaObject::activate (sender=sender@entry=0xeb1fe8, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3702
#10 0x00007f6195a34057 in QMetaObject::activate (sender=sender@entry=0xeb1fe8, m=m@entry=0x7f6195c5d580 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3582
#11 0x00007f6195ab3610 in QTimer::timeout (this=this@entry=0xeb1fe8) at .moc/moc_qtimer.cpp:192
#12 0x00007f6195a41918 in QTimer::timerEvent (this=0xeb1fe8, e=<optimized out>) at kernel/qtimer.cpp:247
#13 0x00007f6195a346f3 in QObject::event (this=0xeb1fe8, e=<optimized out>) at kernel/qobject.cpp:1267
#14 0x00007f619630cb2c in QApplicationPrivate::notify_helper (this=0xde6510, receiver=0xeb1fe8, e=0x7ffe665996d0) at kernel/qapplication.cpp:3720
#15 0x00007f6196312000 in QApplication::notify (this=0x7ffe66599aa0, receiver=0xeb1fe8, e=0x7ffe665996d0) at kernel/qapplication.cpp:3503
#16 0x00007f6195a02c2b in QCoreApplication::notifyInternal (this=0x7ffe66599aa0, receiver=0xeb1fe8, event=event@entry=0x7ffe665996d0) at kernel/qcoreapplication.cpp:935
#17 0x00007f6195a5aae5 in sendEvent (event=0x7ffe665996d0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:228
#18 QTimerInfoList::activateTimers (this=0xe1da20) at kernel/qtimerinfo_unix.cpp:635
#19 0x00007f6195a5af61 in timerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:177
#20 0x00007f619184fc3d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007f619184ff20 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007f619184ffcc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007f6195a5bc57 in QEventDispatcherGlib::processEvents (this=0xe24850, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#24 0x00007f6195a003e2 in QEventLoop::exec (this=this@entry=0x7ffe66599920, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#25 0x00007f6195a0802c in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1188
#26 0x00007f6195d4731c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1510
#27 0x00007f61963087a5 in QApplication::exec () at kernel/qapplication.cpp:2956
#28 0x000000000042fd9b in main (argc=2, argv=<optimized out>) at ../../shell/main.cpp:158

Possible duplicates by query: bug 346407.

Reported using DrKonqi
Comment 1 David Edmundson 2015-04-27 08:34:46 UTC
*** Bug 346407 has been marked as a duplicate of this bug. ***
Comment 2 David Edmundson 2015-04-27 08:34:56 UTC
*** Bug 346766 has been marked as a duplicate of this bug. ***
Comment 3 Sebastian Kügler 2015-05-05 22:10:17 UTC
Looks like a race condition in the startup-multiscreen dance.

Proposed patch: https://git.reviewboard.kde.org/r/123648/
Comment 4 Sebastian Kügler 2015-05-06 00:04:59 UTC
Git commit 8e12bd4bdee86fabc3e2985922aae73916cef700 by Sebastian Kügler.
Committed on 05/05/2015 at 23:56.
Pushed by sebas into branch 'Plasma/5.3'.

Guard access to kscreen configuration

reconsiderOutputs() may be called before the async config fetching
operation (KScreen::GetConfigOperation) has finished, so the pointer is
still null at that point. This can happen if qApp::screenRemoved fires
before kscreen was able to start the backend loader and pass back a
ConfigPtr.

The bug is rooted by in the dual-use of libkscreen and qApp's QScreen
handling. The timings here produce this race condition. This patch
should be quite safe, though, since it doesn't change the logic, but
rather makes sure this race condition bails out nicely by falling back
to just waiting until a kscreen config has arrived (which will happen
right after).
REVIEW:123648
FIXED-IN:5.3.1
CHANGELOG:Fix crash on Plasma startup caused by a race condition

M  +4    -2    shell/shellcorona.cpp

http://commits.kde.org/plasma-workspace/8e12bd4bdee86fabc3e2985922aae73916cef700