Bug 160871 - Crash while alt tabbing with Cover switch
Summary: Crash while alt tabbing with Cover switch
Alias: None
Product: kwin
Classification: Unclassified
Component: compositing (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: Martin Flöser
Depends on:
Reported: 2008-04-15 19:13 UTC by Arnout Boelens
Modified: 2008-04-28 17:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:

Backtrace kwin (5.22 KB, text/plain)
2008-04-15 19:14 UTC, Arnout Boelens

Note You need to log in before you can comment on or make changes to this bug.
Description Arnout Boelens 2008-04-15 19:13:27 UTC
Version:           4:4.0.68+svn794641-1 Debian experimental (using Devel)
Installed from:    Compiled sources
OS:                Linux

I am not sure how to reproduce this, but sometimes alt tabbing using the "Cover switch" plugin causes kwin to crash. I attached a backtrace.
Comment 1 Arnout Boelens 2008-04-15 19:14:01 UTC
Created attachment 24341 [details]
Backtrace kwin
Comment 2 Martin Flöser 2008-04-15 19:40:33 UTC
I have never seen a crash with this effect...

When looking at the backtrace I saw one thing that struck me: do you have the zoom effect enabled when the crash appeared?
Comment 3 Arnout Boelens 2008-04-15 19:46:08 UTC
I just checked and yes, zoom was enabled.
Comment 4 Martin Flöser 2008-04-15 20:21:06 UTC
>I just checked and yes, zoom was enabled. 
It was a guess and I think I guessed wrong.

As you post in your initial comment it will become difficult to track this crash. I looked at the mentioned code and I have a very good guess.

for( int i=0; i < rightWindowCount; i++ )
EffectWindow* window = rightWindows->at( i );
x = window->x();
The crash appears when accessing the window pointer. rightWindowCount is a previous stored "rightWindows->count()". So in case that one window disappears during window switching rightWindowCount > rightWindows->count() in the for loop leading to a null pointer.

Do you think that this is possible in your situation? A window disappearing during switching? I know kopete to be such a candidate. If yes I would prepare a patch with some null pointer checks.
Comment 5 Arnout Boelens 2008-04-15 22:02:31 UTC
I do remember I was opening and closing some programs at the moment the crash happened, so what you are saying sounds very probable.
Comment 6 Martin Flöser 2008-04-28 17:01:30 UTC
SVN commit 802111 by graesslin:

Adding some checks for Null-pointers. This should prevent from very unlikely crashes when a window closes during the animation.
BUG: 160871

 M  +10 -0     coverswitch.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=802111