Bug 242165 - KWin crashed after maximizing a window by pressing the maximize button (with Aurorae)
Summary: KWin crashed after maximizing a window by pressing the maximize button (with ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: decorations (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Martin Flöser
URL:
Keywords:
: 269237 280704 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-19 14:13 UTC by Jan Gerrit Marker
Modified: 2011-08-24 13:41 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.5.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Gerrit Marker 2010-06-19 14:13:20 UTC
Application: kwin (4.4.86 (KDE 4.4.86 (KDE 4.5 >= 20100616)) "release 3")
KDE Platform Version: 4.4.86 (KDE 4.4.86 (KDE 4.5 >= 20100616)) "release 3"
Qt Version: 4.6.3
Operating System: Linux 2.6.31.12-0.2-desktop x86_64
Distribution: "openSUSE 11.2 (x86_64)"

-- Information about the crash:
- What I was doing when the application crashed:
I pressed the maximize button of the window decoration.
- Custom settings of the application:
The decoration is Aurorae with "air-oxygen" (version 0.4 from kde-look.org). There is an option set in kwinrc which says KWin to not use a decoration when the window is maximized:
BorderlessMaximizedWindows=true
The window I wanted to maximize was not grouped and the blur effect is activated. Maximizing works if I double click the title or if I drag the window to the top.

The crash can be reproduced every time.

-- Backtrace:
Application: KWin (kwin), signal: Segmentation fault
[KCrash Handler]
#6  QGraphicsItemPrivate::invalidateParentGraphicsEffectsRecursively (this=0x0) at graphicsview/qgraphicsitem.cpp:5157
#7  0x00007f64083ee727 in QGraphicsItem::update (this=0xabaef0, rect=...) at graphicsview/qgraphicsitem.cpp:5427
#8  0x00007f63f76f1215 in Aurorae::AuroraeMaximizeButton::mouseReleaseEvent (this=<value optimized out>, event=0x7fff3784fae0)
    at /usr/src/debug/kdebase-workspace-4.4.86svn1138650/kwin/clients/aurorae/src/lib/auroraebutton.cpp:398
#9  0x00007f6408400ac4 in QGraphicsItem::sceneEvent (this=0xabaef0, event=0x7fff3784f240) at graphicsview/qgraphicsitem.cpp:6543
#10 0x00007f6408416fa8 in QGraphicsScenePrivate::sendMouseEvent (this=0xafb720, mouseEvent=0x7fff3784fae0) at graphicsview/qgraphicsscene.cpp:1256
#11 0x00007f640841b015 in QGraphicsScene::mouseReleaseEvent (this=<value optimized out>, mouseEvent=0x7fff3784fae0) at graphicsview/qgraphicsscene.cpp:4064
#12 0x00007f63f76f32ae in Aurorae::AuroraeScene::mouseReleaseEvent (this=0x0, event=0x7fff3784f240)
    at /usr/src/debug/kdebase-workspace-4.4.86svn1138650/kwin/clients/aurorae/src/lib/auroraescene.cpp:897
#13 0x00007f640842d71f in QGraphicsScene::event (this=0xa28100, event=0x7fff3784fae0) at graphicsview/qgraphicsscene.cpp:3399
#14 0x00007f6407e2635c in QApplicationPrivate::notify_helper (this=0x634bd0, receiver=0xa28100, e=0x7fff3784fae0) at kernel/qapplication.cpp:4302
#15 0x00007f6407e2c93b in QApplication::notify (this=0x7fff37851080, receiver=0xa28100, e=0x7fff3784fae0) at kernel/qapplication.cpp:4185
#16 0x00007f640bc4b246 in KApplication::notify (this=0x7fff37851080, receiver=0xa28100, event=0x7fff3784fae0) at /usr/src/debug/kdelibs-4.4.86svn1138650/kdeui/kernel/kapplication.cpp:302
#17 0x00007f6408c5f67c in QCoreApplication::notifyInternal (this=0x7fff37851080, receiver=0xa28100, event=0x7fff3784fae0) at kernel/qcoreapplication.cpp:726
#18 0x00007f6408448115 in QGraphicsView::mouseReleaseEvent (this=0xaccc20, event=0x7fff37850510) at graphicsview/qgraphicsview.cpp:3259
#19 0x00007f6407e7c652 in QWidget::event (this=0xaccc20, event=0x7fff37850510) at kernel/qwidget.cpp:8044
#20 0x00007f6408203e86 in QFrame::event (this=0xaccc20, e=0x7fff37850510) at widgets/qframe.cpp:557
#21 0x00007f6408444b8b in QGraphicsView::viewportEvent (this=0xaccc20, event=0x7fff37850510) at graphicsview/qgraphicsview.cpp:2787
#22 0x00007f6408c5ea87 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<value optimized out>, receiver=0xa06b70, event=0x7fff37850510) at kernel/qcoreapplication.cpp:841
#23 0x00007f6407e2632c in QApplicationPrivate::notify_helper (this=0x634bd0, receiver=0xa06b70, e=0x7fff37850510) at kernel/qapplication.cpp:4298
#24 0x00007f6407e2d11b in QApplication::notify (this=0x7fff37851080, receiver=0xa06b70, e=0x7fff37850510) at kernel/qapplication.cpp:3867
#25 0x00007f640bc4b246 in KApplication::notify (this=0x7fff37851080, receiver=0xa06b70, event=0x7fff37850510) at /usr/src/debug/kdelibs-4.4.86svn1138650/kdeui/kernel/kapplication.cpp:302
#26 0x00007f6408c5f67c in QCoreApplication::notifyInternal (this=0x7fff37851080, receiver=0xa06b70, event=0x7fff37850510) at kernel/qcoreapplication.cpp:726
#27 0x00007f6407e2c2f6 in sendEvent (event=<value optimized out>, receiver=<value optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:215
#28 QApplicationPrivate::sendMouseEvent (event=<value optimized out>, receiver=<value optimized out>) at kernel/qapplication.cpp:2967
#29 0x00007f6407eabf75 in QETWidget::translateMouseEvent (this=0xa06b70, event=<value optimized out>) at kernel/qapplication_x11.cpp:4380
#30 0x00007f6407eaac8a in QApplication::x11ProcessEvent (this=<value optimized out>, event=0x7fff37850e40) at kernel/qapplication_x11.cpp:3513
#31 0x00007f6407ed5849 in QEventDispatcherX11::processEvents (this=<value optimized out>, flags=) at kernel/qeventdispatcher_x11.cpp:132
#32 0x00007f6408c5df92 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#33 0x00007f6408c5e36c in QEventLoop::exec (this=0x7fff37850fc0, flags=) at kernel/qeventloop.cpp:201
#34 0x00007f6408c6301b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1003
#35 0x00007f640c4113ca in kdemain (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/debug/kdebase-workspace-4.4.86svn1138650/kwin/main.cpp:531
#36 0x00007f640c080a7d in __libc_start_main () from /lib64/libc.so.6
#37 0x0000000000400699 in _start () at ../sysdeps/x86_64/elf/start.S:113

Reported using DrKonqi
Comment 1 Thomas Lübking 2010-06-19 14:30:00 UTC

*** This bug has been marked as a duplicate of bug 242116 ***
Comment 2 Martin Flöser 2010-06-19 14:58:08 UTC
backtraces are different. This crash is caused by clicking maximize button, other crash is caused by closing a window.
Comment 3 Thomas Lübking 2010-06-19 15:14:45 UTC
both traces end on:
QGraphicsScene::mouseReleaseEvent() -> QGraphicsItem::update() -> QGraphicsItemPrivate::invalidateParentGraphicsEffectsRecursively (this=0x0)

the maximize causes a reset which sets the buttons, apparently invoking (on a rough look on the code) a deletion of the former ones, long story short_

AuroraeButton::mouseReleaseEvent() can cause self deletion through "emit clicked();" which you want to emit after the update and baseclass call... :-P
Comment 4 Martin Flöser 2010-06-19 15:32:30 UTC
yes that's what I just figured out, too. I guess for clicks on close buttons that happens, too - also I'm not able to reproduce it there.
Comment 5 Martin Flöser 2010-06-19 15:45:50 UTC
damn it - if I ensure that the internal handling is called before emitting the signal, it just dies somewhere else:

Application: KWin (kwin), signal: Segmentation fault
The current source language is "auto; currently asm".
[KCrash Handler]
#6  0x00007f2a882440b4 in QAbstractScrollArea::viewport (this=0x2ed06c0) at widgets/qabstractscrollarea.cpp:568
#7  0x00007f2a883feb81 in QGraphicsView::mouseReleaseEvent (this=0x2ed06c0, event=<value optimized out>) at graphicsview/qgraphicsview.cpp:3267
#8  0x00007f2a87e12602 in QWidget::event (this=0x2ed06c0, event=0x7fff59ef39b0) at kernel/qwidget.cpp:8044
#9  0x00007f2a881b9946 in QFrame::event (this=0x2ed06c0, e=0x7fff59ef39b0) at widgets/qframe.cpp:557
#10 0x00007f2a883fcdab in QGraphicsView::viewportEvent (this=0x2ed06c0, event=0x7fff59ef39b0) at graphicsview/qgraphicsview.cpp:2787
#11 0x00007f2a88e92577 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<value optimized out>, receiver=0x2ed5ea0, event=0x7fff59ef39b0) at kernel/qcoreapplication.cpp:841
#12 0x00007f2a87dbc2fc in QApplicationPrivate::notify_helper (this=0x2616d20, receiver=0x2ed5ea0, e=0x7fff59ef39b0) at kernel/qapplication.cpp:4298
#13 0x00007f2a87dc2fdb in QApplication::notify (this=0x7fff59ef4510, receiver=0x2ed5ea0, e=0x7fff59ef39b0) at kernel/qapplication.cpp:3867
#14 0x00007f2a89b48bb6 in KApplication::notify (this=0x7fff59ef4510, receiver=0x2ed5ea0, event=0x7fff59ef39b0) at /opt/kde/src/KDE/kdelibs/kdeui/kernel/kapplication.cpp:302
#15 0x00007f2a88e9315c in QCoreApplication::notifyInternal (this=0x7fff59ef4510, receiver=0x2ed5ea0, event=0x7fff59ef39b0) at kernel/qcoreapplication.cpp:726
#16 0x00007f2a87dc21be in QCoreApplication::sendEvent (receiver=0x2ed5ea0, event=0x7fff59ef39b0, alienWidget=0x0, nativeWidget=0x2ed5ea0, buttonDown=<value optimized out>, 
    lastMouseReceiver=<value optimized out>, spontaneous=true) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#17 QApplicationPrivate::sendMouseEvent (receiver=0x2ed5ea0, event=0x7fff59ef39b0, alienWidget=0x0, nativeWidget=0x2ed5ea0, buttonDown=<value optimized out>, lastMouseReceiver=<value optimized out>, 
    spontaneous=true) at kernel/qapplication.cpp:2967
#18 0x00007f2a87e4203b in QETWidget::translateMouseEvent (this=0x2ed5ea0, event=<value optimized out>) at kernel/qapplication_x11.cpp:4380
#19 0x00007f2a87e409ac in QApplication::x11ProcessEvent (this=<value optimized out>, event=0x7fff59ef4130) at kernel/qapplication_x11.cpp:3513
#20 0x00007f2a87e6c552 in x11EventSourceDispatch (s=0x261aa60, callback=<value optimized out>, user_data=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:146
#21 0x00007f2a80a0f6c2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#22 0x00007f2a80a13538 in ?? () from /lib/libglib-2.0.so.0
#23 0x00007f2a80a136ec in g_main_context_iteration () from /lib/libglib-2.0.so.0
#24 0x00007f2a88ebc713 in QEventDispatcherGlib::processEvents (this=0x25f3970, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:412
#25 0x00007f2a87e6c14e in QGuiEventDispatcherGlib::processEvents (this=0x2ed06c0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#26 0x00007f2a88e91a82 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#27 0x00007f2a88e91e5c in QEventLoop::exec (this=0x7fff59ef4450, flags=) at kernel/qeventloop.cpp:201
#28 0x00007f2a88e96aeb in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1003
#29 0x00007f2a8b3c62c2 in kdemain (argc=<value optimized out>, argv=<value optimized out>) at /opt/kde/src/KDE/kdebase/workspace/kwin/main.cpp:527
#30 0x00007f2a85129c4d in __libc_start_main (main=<value optimized out>, argc=<value optimized out>, ubp_av=<value optimized out>, init=<value optimized out>, fini=<value optimized out>, 
    rtld_fini=<value optimized out>, stack_end=0x7fff59ef4b18) at libc-start.c:228
#31 0x0000000000400849 in _start ()
Comment 6 Thomas Lübking 2010-06-19 16:13:29 UTC
try "event->accept()" to prevent further handling.

however i don't know how QGraphicsStuff handles this, so it might actually be required to take the item out of moc and use a deleteLater() on it (or pass the click signal through a QTimer::singleShot to get it outside the current event loop
Comment 7 Martin Flöser 2010-06-19 16:25:44 UTC
From Qt documentation: Calling QEvent::ignore() or QEvent::accept() on event has no effect. It get's further processed and it just crashes somewhere else. I tried with deleteLater and the singleShot and it always just crashed somewhere else.

I have now a solution which solves this crash (and probably the other ones, too) but causes kwin to crash on shutdown:

diff --git a/client.cpp b/client.cpp
index 61656c2..c2c17cf 100644
--- a/client.cpp
+++ b/client.cpp
@@ -374,7 +374,7 @@ void Client::destroyDecoration()
     QRect oldgeom = geometry();
     if( decoration != NULL )
         {
-        delete decoration;
+        decoration->deleteLater();
         decoration = NULL;
         QPoint grav = calculateGravitation( true );
         border_left = border_right = border_top = border_bottom = 0;
Comment 8 Martin Flöser 2010-06-19 17:15:07 UTC
SVN commit 1139942 by graesslin:

Defer deletion of the AuroraeScene and View to the next event loop. It is possible that the scene get's deleted before processing mouse events is finished which causes crashes.
BUG: 242165
FIXED-IN: 4.5.0
CCBUG: 241876
CCBUG: 242116

 M  +8 -1      aurorae.cpp  
 M  +1 -0      aurorae.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1139942
Comment 9 Thomas Lübking 2011-03-23 16:42:46 UTC
*** Bug 269237 has been marked as a duplicate of this bug. ***
Comment 10 Thomas Lübking 2011-03-23 16:43:54 UTC
re-appeared in 4.6.n (some git master i presume)
reopening for the moment... :-(
Comment 11 bayleak38 2011-03-23 17:26:13 UTC
i just counterchecked. this bug does not occur in kwin 4.6.0, just in 4.6.1
Comment 12 Thomas Lübking 2011-04-21 20:26:05 UTC
*** Bug 271435 has been marked as a duplicate of this bug. ***
Comment 13 Martin Flöser 2011-05-06 22:21:18 UTC
I don't think it is the same crash as the duplicate is an assert while the original crash was a crash.
Comment 14 Thomas Lübking 2011-08-24 13:41:07 UTC
*** Bug 280704 has been marked as a duplicate of this bug. ***