Bug 166960

Summary: KWin might crash if a window is deleted while an effect is using the window
Product: [Plasma] kwin Reporter: Piotr Pełzowski <pelzowski>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: crash CC: rap
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Piotr Pełzowski 2008-07-18 23:24:27 UTC
Version:            (using KDE 4.0.98)
Installed from:    SuSE RPMs

When using the "Cover Switch" (and "Flip Switch" as reported in Bug 159519 , Comment #2)  plugin, the key sequence Ctrl+F12, Alt+Tab causes KWin to crash. 

As already said in Bug 159519:

"(Bring up the dashboard, try to Alt+Tab to another window, KWin tries to show window on top of Dashboard, and KWin crashes. (KWin also, instantaneously respawns, which is nice though, meaning no real effect except the KDE Crash Handler appears.) The "Box Switch" plugin does not appear to have this problem - Dashboard simply disappears as soon as you select another window."
Comment 1 Martin Flöser 2008-07-19 00:14:24 UTC
If you are able to reproduce (I'm not) please provide a backtrace.

Please see: http://techbase.kde.org/Contribute/Bugsquad/How_to_create_useful_crash_reports
Comment 2 Ramon Antonio Parada (brainsqueezer) 2008-07-23 00:05:45 UTC
I followed steps with Cover switch with 4.0.98 (debian experimental).

If you press Alt+Tab too fast there is no crash (when you press so little time that coverswitch is not shown and just changes between windows). Must keep Alt+Tab pressed for cover switch to be shown and then press Alt+Tab another second time to change to another app. Not always crashes


Application: KWin (kwin), signal SIGSEGV
(no debugging symbols found) x5
[Thread debugging using libthread_db enabled]
[New Thread 0xb585c720 (LWP 14667)]
[KCrash handler]
#6  0xb38c7f6f in ?? () from /usr/lib/kde4/kwin4_effect_builtins.so
#7  0x0815a2a8 in ?? ()
#8  0x0823f1c0 in ?? ()
#9  0xfffffb00 in ?? ()
#10 0x00000000 in ?? ()
#0  0xffffe424 in __kernel_vsyscall ()
Comment 3 Raúl 2008-07-23 00:48:15 UTC
I can't reproduce it here with 4.0.98 on debian experimental. Maybe it's a driver specific issue. I'm owning an intel video card (955GM) with latest 2.3.2 driver.

As I've been told by reporter in #2, he's using: nVidia Corporation C51 [Geforce 6150 Go] (rev a2).

HTH.
Comment 4 Ramon Antonio Parada (brainsqueezer) 2008-07-23 01:06:44 UTC
Application: KWin (kwin), signal SIGSEGV
[Thread debugging using libthread_db enabled]
[New Thread 0xb573a720 (LWP 15266)]
[KCrash handler]
#6  KWin::CoverSwitchEffect::paintScene (this=0x82060e8, 
    frontWindow=0x8145418, leftWindows=0xbf95ef00, rightWindows=0xbf95eefc, 
    reflectedWindows=false)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects/coverswitch.cpp:413
#7  0xb37a6f36 in KWin::CoverSwitchEffect::paintScreen (this=0x82060e8, 
    mask=32, region=
        {d = 0xbf95ef58, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects/coverswitch.cpp:247
#8  0xb7f10866 in KWin::EffectsHandlerImpl::paintScreen (this=0x8135b28, 
    mask=32, region=
        {d = 0xbf95ef98, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects.cpp:113
#9  0xb7cf4876 in KWin::Effect::paintScreen (this=0x8111250, mask=32, region=
        {d = 0xbf95efd8, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/lib/kwineffects.cpp:180
#10 0xb7f10866 in KWin::EffectsHandlerImpl::paintScreen (this=0x8135b28, 
    mask=32, region=
        {d = 0xbf95f098, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects.cpp:113
#11 0xb377a490 in KWin::DesktopGridEffect::paintScreen (this=0x81b8388, 
    mask=32, region=
        {d = 0xbf95f0d8, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects/desktopgrid.cpp:131
#12 0xb7f10866 in KWin::EffectsHandlerImpl::paintScreen (this=0x8135b28, 
    mask=32, region=
        {d = 0xbf95f118, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects.cpp:113
#13 0xb7cf4876 in KWin::Effect::paintScreen (this=0x81ea518, mask=32, region=
        {d = 0xbf95f158, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/lib/kwineffects.cpp:180
#14 0xb7f10866 in KWin::EffectsHandlerImpl::paintScreen (this=0x8135b28, 
    mask=32, region=
        {d = 0xbf95f198, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects.cpp:113
#15 0xb7cf4876 in KWin::Effect::paintScreen (this=0x81d9468, mask=32, region=
        {d = 0xbf95f1d8, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/lib/kwineffects.cpp:180
#16 0xb7f10866 in KWin::EffectsHandlerImpl::paintScreen (this=0x8135b28, 
    mask=32, region=
        {d = 0xbf95f218, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects.cpp:113
#17 0xb7cf4876 in KWin::Effect::paintScreen (this=0x81a30a8, mask=32, region=
        {d = 0xbf95f258, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/lib/kwineffects.cpp:180
#18 0xb7f10866 in KWin::EffectsHandlerImpl::paintScreen (this=0x8135b28, 
    mask=32, region=
        {d = 0xbf95f298, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects.cpp:113
#19 0xb7cf4876 in KWin::Effect::paintScreen (this=0x81bcab0, mask=32, region=
        {d = 0xbf95f2d8, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/lib/kwineffects.cpp:180
#20 0xb7f10866 in KWin::EffectsHandlerImpl::paintScreen (this=0x8135b28, 
    mask=32, region=
        {d = 0xbf95f364, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects.cpp:113
#21 0xb37b13a0 in KWin::MouseMarkEffect::paintScreen (this=0x81c0ad8, mask=32, 
    region=
        {d = 0xbf95f3a8, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects/mousemark.cpp:69
#22 0xb7f10866 in KWin::EffectsHandlerImpl::paintScreen (this=0x8135b28, 
    mask=32, region=
        {d = 0xbf95f3f8, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects.cpp:113
#23 0xb3459a36 in KWin::VideoRecordEffect::paintScreen (this=0x81c2228, 
    mask=32, region=
        {d = 0xbf95f438, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects/videorecord.cpp:82
#24 0xb7f10866 in KWin::EffectsHandlerImpl::paintScreen (this=0x8135b28, 
    mask=32, region=
        {d = 0xbf95f4c0, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, data=@0xbf95f478)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/effects.cpp:113
#25 0xb7efe1ae in KWin::Scene::paintScreen (this=0x823db08, mask=0xbf95f544, 
    region=0xbf95f5f8)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/scene.cpp:131
#26 0xb7f08dea in KWin::SceneOpenGL::paint (this=0x823db08, damage=
        {d = 0xbf95f5f8, static shared_empty = {ref = {_q_value = 109}, rgn = 0x0, xrectangles = 0x0, qt_rgn = 0x0}}, toplevels=
        {{p = {static shared_null = {ref = {_q_value = 2960}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xbf95f5f4}, d = 0xbf95f5f4}})
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/scene_opengl.cpp:622
#27 0xb7ef9f9c in KWin::Workspace::performCompositing (this=0x80ba9d0)
    at /tmp/buildd/kdebase-workspace-4.0.98/kwin/composite.cpp:351
#28 0xb7e9510d in KWin::Workspace::qt_metacall (this=0x80ba9d0, 
    _c=QMetaObject::InvokeMetaMethod, _id=137, _a=0xbf95f6c8)
    at /tmp/buildd/kdebase-workspace-4.0.98/obj-i486-linux-gnu/kwin/workspace.moc:433
#29 0xb6b5c0c0 in QMetaObject::activate (sender=0x80bac1c, 
    from_signal_index=4, to_signal_index=4, argv=0x0)
    at kernel/qobject.cpp:3010
#30 0xb6b5ce42 in QMetaObject::activate (sender=0x80bac1c, m=0xb6c29ae4, 
    local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3080
#31 0xb6b96f37 in QTimer::timeout (this=0x80bac1c)
    at .moc/release-shared/moc_qtimer.cpp:126
#32 0xb6b62aee in QTimer::timerEvent (this=0x80bac1c, e=0xbf95fb8c)
    at kernel/qtimer.cpp:263
#33 0xb6b56baf in QObject::event (this=0x80bac1c, e=0xbf95fb8c)
    at kernel/qobject.cpp:1105
#34 0xb731766c in QApplicationPrivate::notify_helper (this=0x8054b18, 
    receiver=0x80bac1c, e=0xbf95fb8c) at kernel/qapplication.cpp:3772
#35 0xb731f43e in QApplication::notify (this=0xbf95fe64, receiver=0x80bac1c, 
    e=0xbf95fb8c) at kernel/qapplication.cpp:3366
#36 0xb704563d in KApplication::notify (this=0xbf95fe64, receiver=0x80bac1c, 
    event=0xbf95fb8c)
    at /tmp/buildd/kde4libs-4.0.98+svn833207/kdeui/kernel/kapplication.cpp:311
#37 0xb7eac48d in KWin::Application::notify (this=0xbf95fe64, o=0x80bac1c, 
    e=0xbf95fb8c) at /tmp/buildd/kdebase-workspace-4.0.98/kwin/main.cpp:369
#38 0xb6b47571 in QCoreApplication::notifyInternal (this=0xbf95fe64, 
    receiver=0x80bac1c, event=0xbf95fb8c) at kernel/qcoreapplication.cpp:587
#39 0xb6b755e1 in QTimerInfoList::activateTimers (this=0x80579ac)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#40 0xb6b71c20 in timerSourceDispatch (source=0x8057978)
    at kernel/qeventdispatcher_glib.cpp:166
#41 0xb67282f1 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#42 0xb672b983 in ?? () from /usr/lib/libglib-2.0.so.0
#43 0x08056c78 in ?? ()
#44 0x00000000 in ?? ()
#0  0xffffe424 in __kernel_vsyscall ()


Desktop effects: enabled
Compositing type: OpenGL
Keep thumbnals of open windows up to date: No
OpenGL mode: Texture From Pixmap
Texture Filter: Bilinear
Direct Rendering: No
Use Vsync: Yes

Kernel: 2.6.25.9 (custom)
Graphics card: nVidia Corporation C51 [Geforce 6150 Go] (rev a2). 
Nvidia driver: 173.14.09 (debian binaries)


xorg.conf
Section "Device"
   Identifier     "nVidia Corporation C51 [Geforce 6150 Go]"
   Driver         "nvidia"
   BusID          "PCI:0:5:0"
   Option         "RenderAccel" "true"
   Screen         0

   Option        "AddARGBGLXVisuals"
   Option       "backingstore" "true"
   Option        "AllowGLXWithComposite"   "true"
   Option       "TripleBuffer"   "true"
   Option         "RandRRotation" "yes"
EndSection

Comment 5 Martin Flöser 2008-07-23 09:21:40 UTC
Thanks for the crash report - that really helps.

As said in comment #2 the crash happens when switching away from dashboard to another window. In that moment the dashboard is removed which leads to a NULL pointer.

The problem does not only exist in in coverswitch but basically in all effects. I just was able to reproduce the crash and the crash appeared in blur effect.

Is it possible to delete the window at the end of the rendering process, that is after all effects have been processed and before the next screen painting is started?
Comment 6 Diederik van der Boor 2008-08-03 19:45:37 UTC
I've got a different backtrace for a similar issue. KDE version is 4.1

Programma: KWin (kwin), signaal SIGSEGV
[?1034hUsing host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 0xb5a8b910 (LWP 3938)]
[KCrash handler]
#6  0xb383d221 in KWin::CoverSwitchEffect::paintFrontWindow ()
   from /usr/lib/kde4/kwin4_effect_builtins.so
#7  0xb383e281 in KWin::CoverSwitchEffect::paintScene ()
   from /usr/lib/kde4/kwin4_effect_builtins.so
#8  0xb3840489 in KWin::CoverSwitchEffect::paintScreen ()
   from /usr/lib/kde4/kwin4_effect_builtins.so
#9  0xb7f4ca21 in KWin::EffectsHandlerImpl::paintScreen ()
   from /usr/lib/libkdeinit4_kwin.so
#10 0xb7d0bd76 in KWin::Effect::paintScreen ()
   from /usr/lib/libkwineffects.so.1
#11 0xb7f4ca21 in KWin::EffectsHandlerImpl::paintScreen ()
   from /usr/lib/libkdeinit4_kwin.so
#12 0xb3814369 in KWin::DesktopGridEffect::paintScreen ()
   from /usr/lib/kde4/kwin4_effect_builtins.so
#13 0xb7f4ca21 in KWin::EffectsHandlerImpl::paintScreen ()
   from /usr/lib/libkdeinit4_kwin.so
#14 0xb7d0bd76 in KWin::Effect::paintScreen ()
   from /usr/lib/libkwineffects.so.1
#15 0xb7f4ca21 in KWin::EffectsHandlerImpl::paintScreen ()
   from /usr/lib/libkdeinit4_kwin.so
#16 0xb7d0bd76 in KWin::Effect::paintScreen ()
   from /usr/lib/libkwineffects.so.1
#17 0xb7f4ca21 in KWin::EffectsHandlerImpl::paintScreen ()
   from /usr/lib/libkdeinit4_kwin.so
#18 0xb384af10 in KWin::TrackMouseEffect::paintScreen ()
   from /usr/lib/kde4/kwin4_effect_builtins.so
#19 0xb7f4ca21 in KWin::EffectsHandlerImpl::paintScreen ()
   from /usr/lib/libkdeinit4_kwin.so
#20 0xb3839d0d in KWin::ZoomEffect::paintScreen ()
   from /usr/lib/kde4/kwin4_effect_builtins.so
#21 0xb7f4ca21 in KWin::EffectsHandlerImpl::paintScreen ()
   from /usr/lib/libkdeinit4_kwin.so
#22 0xb7f3bece in KWin::Scene::paintScreen () from /usr/lib/libkdeinit4_kwin.so
#23 0xb7f46b5d in KWin::SceneOpenGL::paint () from /usr/lib/libkdeinit4_kwin.so
#24 0xb7f374be in KWin::Workspace::performCompositing ()
   from /usr/lib/libkdeinit4_kwin.so
#25 0xb7eda439 in KWin::Workspace::qt_metacall ()
   from /usr/lib/libkdeinit4_kwin.so
#26 0xb7a2537a in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#27 0xb7a257c2 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#28 0xb7a5d5e7 in QTimer::timeout () from /usr/lib/libQtCore.so.4
#29 0xb7a2debe in QTimer::timerEvent () from /usr/lib/libQtCore.so.4
#30 0xb7a24234 in QObject::event () from /usr/lib/libQtCore.so.4
#31 0xb714000c in QApplicationPrivate::notify_helper ()
   from /usr/lib/libQtGui.so.4
#32 0xb7146ff9 in QApplication::notify () from /usr/lib/libQtGui.so.4
#33 0xb6de5b1d in KApplication::notify () from /usr/lib/libkdeui.so.5
#34 0xb7ef00ad in KWin::Application::notify ()
   from /usr/lib/libkdeinit4_kwin.so
#35 0xb7a14d09 in QCoreApplication::notifyInternal ()
   from /usr/lib/libQtCore.so.4
#36 0xb7a3d901 in QTimerInfoList::activateTimers ()
   from /usr/lib/libQtCore.so.4
#37 0xb7a3ddc5 in QEventDispatcherUNIX::activateTimers ()
   from /usr/lib/libQtCore.so.4
#38 0xb7a3debb in QEventDispatcherUNIX::processEvents ()
   from /usr/lib/libQtCore.so.4
#39 0xb71c5cd1 in QEventDispatcherX11::processEvents ()
   from /usr/lib/libQtGui.so.4
#40 0xb7a13f9d in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#41 0xb7a14131 in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#42 0xb7a1627a in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#43 0xb713f707 in QApplication::exec () from /usr/lib/libQtGui.so.4
#44 0xb7ef1ede in kdemain () from /usr/lib/libkdeinit4_kwin.so
#45 0x080487b2 in main ()
#0  0xffffe410 in __kernel_vsyscall ()
Comment 7 lucas 2008-09-03 12:00:36 UTC
Does this still occur in latest trunk? Neither Lubos or myself can reproduce this.
Comment 8 Martin Flöser 2008-09-24 11:18:57 UTC
I cannot reproduce with trunk as well. Seems to be fixed in Plasma as dashboard does not disappear when using alt+tab.
Comment 9 Lubos Lunak 2008-10-02 11:24:45 UTC
No response, works fine here.