Bug 238334

Summary: [FlipSwitch] Crash in paintWindow()
Product: [Plasma] kwin Reporter: Michal Hozza <mhozza+kde>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Michal Hozza 2010-05-20 20:58:17 UTC
Application: kwin (4.4.2 (KDE 4.4.2))
KDE Platform Version: 4.4.2 (KDE 4.4.2)
Qt Version: 4.6.2
Operating System: Linux 2.6.32-22-generic i686
Distribution: Ubuntu 10.04 LTS

-- Information about the crash:
I have effects turned on and when I switched desktop one window stayed semitransparent(like when hower on anoter taskbar icon) and kwin crashed

The crash can be reproduced some of the time.

 -- Backtrace:
Application: KWin (kwin), signal: Segmentation fault
[Current thread is 1 (Thread 0xb78ce720 (LWP 32711))]

Thread 2 (Thread 0xab93bb70 (LWP 32723)):
#0  0x00b97e16 in clock_gettime () from /lib/tls/i686/cmov/librt.so.1
#1  0x066116fb in qt_gettime () at kernel/qcore_unix.cpp:111
#2  0x06616825 in QTimerInfoList::updateCurrentTime (this=0x9105164) at kernel/qeventdispatcher_unix.cpp:340
#3  0x0661686a in QTimerInfoList::timerWait (this=0x9105164, tm=...) at kernel/qeventdispatcher_unix.cpp:443
#4  0x06614818 in timerSourcePrepareHelper (src=<value optimized out>, timeout=0xab93b0bc) at kernel/qeventdispatcher_glib.cpp:136
#5  0x066148a5 in timerSourcePrepare (source=0x0, timeout=0xb9bff4) at kernel/qeventdispatcher_glib.cpp:169
#6  0x038a7aca in g_main_context_prepare () from /lib/libglib-2.0.so.0
#7  0x038a7ee9 in ?? () from /lib/libglib-2.0.so.0
#8  0x038a84b8 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#9  0x0661460f in QEventDispatcherGlib::processEvents (this=0x91130e8, flags=...) at kernel/qeventdispatcher_glib.cpp:414
#10 0x065e7059 in QEventLoop::processEvents (this=0xab93b280, flags=) at kernel/qeventloop.cpp:149
#11 0x065e74aa in QEventLoop::exec (this=0xab93b280, flags=...) at kernel/qeventloop.cpp:201
#12 0x064e35a8 in QThread::exec (this=0x910e7a8) at thread/qthread.cpp:487
#13 0x065c6c1b in QInotifyFileSystemWatcherEngine::run (this=0x910e7a8) at io/qfilesystemwatcher_inotify.cpp:248
#14 0x064e632e in QThreadPrivate::start (arg=0x910e7a8) at thread/qthread_unix.cpp:248
#15 0x005fb96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#16 0x00c6ba0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb78ce720 (LWP 32711)):
[KCrash Handler]
#6  0x06acc1d5 in KWin::FlipSwitchEffect::paintWindow (this=0x8e973f0, w=0x927f2a0, mask=34, region=..., data=...) at ../../../kwin/effects/flipswitch/flipswitch.cpp:535
#7  0x00704c37 in KWin::EffectsHandlerImpl::paintWindow (this=0x8e43910, w=0x927f2a0, mask=34, region=..., data=...) at ../../kwin/effects.cpp:153
#8  0x06a6b275 in KWin::DesktopGridEffect::paintWindow (this=0x8f52570, w=0x927f2a0, mask=34, region=..., data=...) at ../../../kwin/effects/desktopgrid/desktopgrid.cpp:359
#9  0x00704c37 in KWin::EffectsHandlerImpl::paintWindow (this=0x8e43910, w=0x927f2a0, mask=34, region=..., data=...) at ../../kwin/effects.cpp:153
#10 0x06aa2b42 in KWin::SlideEffect::paintWindow (this=0x8ecd7d8, w=0x927f2a0, mask=34, region=..., data=...) at ../../../kwin/effects/slide/slide.cpp:165
#11 0x00704c37 in KWin::EffectsHandlerImpl::paintWindow (this=0x8e43910, w=0x927f2a0, mask=34, region=..., data=...) at ../../kwin/effects.cpp:153
#12 0x06a80e8c in KWin::TranslucencyEffect::paintWindow (this=0x8f52728, w=0x927f2a0, mask=34, region=..., data=...) at ../../../kwin/effects/translucency/translucency.cpp:180
#13 0x00704c37 in KWin::EffectsHandlerImpl::paintWindow (this=0x8e43910, w=0x927f2a0, mask=34, region=..., data=...) at ../../kwin/effects.cpp:153
#14 0x06aaeac2 in KWin::CoverSwitchEffect::paintWindow (this=0x8f616b0, w=0x927f2a0, mask=34, region=..., data=...) at ../../../kwin/effects/coverswitch/coverswitch.cpp:500
#15 0x00704c37 in KWin::EffectsHandlerImpl::paintWindow (this=0x8e43910, w=0x927f2a0, mask=34, region=..., data=...) at ../../kwin/effects.cpp:153
#16 0x06a7bfc1 in KWin::LoginEffect::paintWindow (this=0x8ecd658, w=0x927f2a0, mask=34, region=..., data=...) at ../../../kwin/effects/login/login.cpp:69
#17 0x00704c37 in KWin::EffectsHandlerImpl::paintWindow (this=0x8e43910, w=0x927f2a0, mask=34, region=..., data=...) at ../../kwin/effects.cpp:153
#18 0x0054a3ad in KWin::Effect::paintWindow (this=0x8f60750, w=0x927f2a0, mask=34, region=..., data=...) at ../../../kwin/lib/kwineffects.cpp:242
#19 0x00704c37 in KWin::EffectsHandlerImpl::paintWindow (this=0x8e43910, w=0x927f2a0, mask=34, region=..., data=...) at ../../kwin/effects.cpp:153
#20 0x006ec9cc in KWin::Scene::paintWindow (this=0x8e47148, w=0x926e338, mask=34, region=..., quads=...) at ../../kwin/scene.cpp:312
#21 0x006ed7a5 in KWin::Scene::paintGenericScreen (this=0x8e47148, orig_mask=<value optimized out>) at ../../kwin/scene.cpp:210
#22 0x006f89f5 in KWin::SceneOpenGL::paintGenericScreen (this=0x8e47148, mask=<value optimized out>, data=...) at ../../kwin/scene_opengl.cpp:880
#23 0x006eb230 in KWin::Scene::finalPaintScreen (this=0x8e47148, mask=32, region=..., data=...) at ../../kwin/scene.cpp:174
#24 0x00704cac in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:126
#25 0x06a7d5d7 in KWin::LogoutEffect::paintScreen (this=0x8f47488, mask=32, region=..., data=...) at ../../../kwin/effects/logout/logout.cpp:196
#26 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#27 0x06a83e6f in KWin::PresentWindowsEffect::paintScreen (this=0x8ecf9b8, mask=32, region=..., data=...) at ../../../kwin/effects/presentwindows/presentwindows.cpp:196
#28 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#29 0x0054a426 in KWin::Effect::paintScreen (this=0x8f58590, mask=32, region=..., data=...) at ../../../kwin/lib/kwineffects.cpp:227
#30 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#31 0x0054a426 in KWin::Effect::paintScreen (this=0x8ebb860, mask=32, region=..., data=...) at ../../../kwin/lib/kwineffects.cpp:227
#32 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#33 0x0054a426 in KWin::Effect::paintScreen (this=0x8ecdca8, mask=32, region=..., data=...) at ../../../kwin/lib/kwineffects.cpp:227
#34 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#35 0x0054a426 in KWin::Effect::paintScreen (this=0x8ec05e0, mask=32, region=..., data=...) at ../../../kwin/lib/kwineffects.cpp:227
#36 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#37 0x0054a426 in KWin::Effect::paintScreen (this=0x8ed7968, mask=32, region=..., data=...) at ../../../kwin/lib/kwineffects.cpp:227
#38 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#39 0x06ac9d32 in KWin::FlipSwitchEffect::paintScreen (this=0x8e973f0, mask=32, region=..., data=...) at ../../../kwin/effects/flipswitch/flipswitch.cpp:146
#40 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#41 0x06a67a83 in KWin::DesktopGridEffect::paintScreen (this=0x8f52570, mask=32, region=..., data=...) at ../../../kwin/effects/desktopgrid/desktopgrid.cpp:151
#42 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#43 0x06aa34ea in KWin::SlideEffect::paintScreen (this=0x8ecd7d8, mask=32, region=..., data=...) at ../../../kwin/effects/slide/slide.cpp:86
#44 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#45 0x0054a426 in KWin::Effect::paintScreen (this=0x8f52728, mask=32, region=..., data=...) at ../../../kwin/lib/kwineffects.cpp:227
#46 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#47 0x06ab0a9c in KWin::CoverSwitchEffect::paintScreen (this=0x8f616b0, mask=32, region=..., data=...) at ../../../kwin/effects/coverswitch/coverswitch.cpp:124
#48 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#49 0x0054a426 in KWin::Effect::paintScreen (this=0x8ecd658, mask=32, region=..., data=...) at ../../../kwin/lib/kwineffects.cpp:227
#50 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#51 0x06aad133 in KWin::ZoomEffect::paintScreen (this=0x8f60748, mask=32, region=..., data=...) at ../../../kwin/effects/zoom/zoom.cpp:73
#52 0x00704d30 in KWin::EffectsHandlerImpl::paintScreen (this=0x8e43910, mask=32, region=..., data=...) at ../../kwin/effects.cpp:122
#53 0x006ecca4 in KWin::Scene::paintScreen (this=0x8e47148, mask=0xbfbf8d98, region=0xbfbf8e64) at ../../kwin/scene.cpp:134
#54 0x006fe53a in KWin::SceneOpenGL::paint (this=0x8e47148, damage=..., toplevels=...) at ../../kwin/scene_opengl.cpp:748
#55 0x006e7604 in KWin::Workspace::performCompositing (this=0x8e33da8) at ../../kwin/composite.cpp:424
#56 0x0065f4a6 in KWin::Workspace::qt_metacall (this=0x8e33da8, _c=QMetaObject::InvokeMetaMethod, _id=173, _a=0xbfbf8f8c) at ./workspace.moc:535
#57 0x065edc9a in QMetaObject::metacall (object=0x8e33da8, cl=157003840, idx=173, argv=0xbfbf8f8c) at kernel/qmetaobject.cpp:237
#58 0x065fc3d5 in QMetaObject::activate (sender=0x8e34030, m=0x66fc5a4, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3293
#59 0x0664daa7 in QTimer::timeout (this=0x8e34030) at .moc/release-shared/moc_qtimer.cpp:134
#60 0x0660460e in QTimer::timerEvent (this=0x8e34030, e=0xbfbf94e0) at kernel/qtimer.cpp:271
#61 0x065f9254 in QObject::event (this=0x8e34030, e=0xbfbf7990) at kernel/qobject.cpp:1212
#62 0x070de4dc in QApplicationPrivate::notify_helper (this=0x8d8d620, receiver=0x8e34030, e=0xbfbf94e0) at kernel/qapplication.cpp:4300
#63 0x070e505e in QApplication::notify (this=0xbfbf9858, receiver=0x8e34030, e=0xbfbf94e0) at kernel/qapplication.cpp:3704
#64 0x002eff2a in KApplication::notify (this=0xbfbf9858, receiver=0x8e34030, event=0xbfbf94e0) at ../../kdeui/kernel/kapplication.cpp:302
#65 0x0067bdef in KWin::Application::notify (this=0xbfbf9858, o=0x8e34030, e=0xbfbf94e0) at ../../kwin/main.cpp:370
#66 0x065e8a3b in QCoreApplication::notifyInternal (this=0xbfbf9858, receiver=0x8e34030, event=0xbfbf94e0) at kernel/qcoreapplication.cpp:704
#67 0x06617d66 in QCoreApplication::sendEvent (this=0x8d90834) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#68 QTimerInfoList::activateTimers (this=0x8d90834) at kernel/qeventdispatcher_unix.cpp:603
#69 0x06614917 in timerSourceDispatch (source=0x8d90868) at kernel/qeventdispatcher_glib.cpp:184
#70 idleTimerSourceDispatch (source=0x8d90868) at kernel/qeventdispatcher_glib.cpp:231
#71 0x038a45e5 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#72 0x038a82d8 in ?? () from /lib/libglib-2.0.so.0
#73 0x038a84b8 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#74 0x066145d5 in QEventDispatcherGlib::processEvents (this=0x8d77de8, flags=...) at kernel/qeventdispatcher_glib.cpp:412
#75 0x0719e135 in QGuiEventDispatcherGlib::processEvents (this=0x8d77de8, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#76 0x065e7059 in QEventLoop::processEvents (this=0xbfbf97a4, flags=) at kernel/qeventloop.cpp:149
#77 0x065e74aa in QEventLoop::exec (this=0xbfbf97a4, flags=...) at kernel/qeventloop.cpp:201
#78 0x065eb69f in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#79 0x070de577 in QApplication::exec () at kernel/qapplication.cpp:3579
#80 0x0067da00 in kdemain (argc=3, argv=0xbfbf9a64) at ../../kwin/main.cpp:526
#81 0x0804860b in main (argc=3, argv=0xbfbf9a64) at kwin_dummy.cpp:3

Possible duplicates by query: bug 235728, bug 235723, bug 230864, bug 228210.

Reported using DrKonqi
Comment 1 Thomas Lübking 2011-05-10 01:10:15 UTC
I see the bug.
crashes in
m_windows[ w ]->opacity = data.opacity;
in ::paintWindow()

and guess what - at this point the hash is not fully protected*, what makes the ItemInfo pointer invalid.

... *sigh* - so let's go one more time :-(


* if ((m_start || m_stop) && !m_windows.contains(w)) is bypassed whenever (m_start || m_stop) is false (most of the time)
Comment 2 Thomas Lübking 2011-05-10 21:59:44 UTC
Git commit af4bbe815ee579d96bc87990f193b9d3cfa6bcf9 by Thomas Lübking.
Committed on 10/05/2011 at 01:46.
Pushed by luebking into branch 'master'.

strip QHash::operator[] from flipswitch

BUG: 238334

M  +25   -31   kwin/effects/flipswitch/flipswitch.cpp     

http://commits.kde.org/kde-workspace/af4bbe815ee579d96bc87990f193b9d3cfa6bcf9