Bug 314593

Summary: kwin crashes when applying "Invert" effect immediately after session unlock
Product: [Plasma] kwin Reporter: Γιώργος Κυλάφας (Giorgos Kylafas) <gekylafas>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: crash Flags: mgraesslin: ReviewRequest+
Priority: NOR    
Version: 4.10.0   
Target Milestone: 4.10.1   
Platform: Ubuntu   
OS: Linux   
URL: https://git.reviewboard.kde.org/r/108828/
Latest Commit: Version Fixed In: 4.10.1
Sentry Crash Report:

Description Γιώργος Κυλάφας (Giorgos Kylafas) 2013-02-07 11:08:50 UTC
Application: kwin (4.10.00)
KDE Platform Version: 4.10.00
Qt Version: 4.8.3
Operating System: Linux 3.5.0-23-generic x86_64
Distribution: Ubuntu 12.10

-- Information about the crash:
- What I was doing when the application crashed:
1. Lock the session (Ctrl+Alt+L)
2. Unlock the session
3. Immediately press  (Ctrl+Meta+U) to apply "Invert" to a window

If I click on a window between steps 2 and 3, no crash happens and the window is inverted normally.

It feels like after unlock a pointer is null or something and it is accessed by "Invert", causing a segmentation fault.

The crash can be reproduced every time.

-- Backtrace:
Application: KWin (kwin), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fa55e4967c0 (LWP 15252))]

Thread 2 (Thread 0x7fa545c85700 (LWP 15262)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007fa56ee72cd7 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#2  0x00007fa56ee72d09 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#3  0x00007fa566950e9a in start_thread (arg=0x7fa545c85700) at pthread_create.c:308
#4  0x00007fa57257bccd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fa55e4967c0 (LWP 15252)):
[KCrash Handler]
#6  parent (this=0x0) at /usr/include/qt4/QtCore/qobject.h:273
#7  KWin::EffectWindow::addRepaintFull (this=0x0) at ../../../kwin/libkwineffects/kwineffects.cpp:783
#8  0x00007fa545d22f09 in KWin::InvertEffect::toggleWindow (this=0x1e24ab0) at ../../../kwin/effects/invert/invert.cpp:153
#9  0x00007fa56d9a6f5f in QMetaObject::activate (sender=0x2033bb0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff17c5f190) at kernel/qobject.cpp:3547
#10 0x00007fa56cd32a32 in QAction::triggered (this=this@entry=0x2033bb0, _t1=false) at .moc/release-shared/moc_qaction.cpp:277
#11 0x00007fa56cd32c20 in QAction::activate (this=0x2033bb0, event=<optimized out>) at kernel/qaction.cpp:1257
#12 0x00007fa5720ad681 in trigger (this=0x2033bb0) at /usr/include/qt4/QtGui/qaction.h:218
#13 KGlobalAccelPrivate::_k_invokeAction (this=0x15239f0, componentUnique=..., actionUnique=..., timestamp=6744479) at ../../kdeui/shortcuts/kglobalaccel.cpp:449
#14 0x00007fa56d9a6f5f in QMetaObject::activate (sender=0x165ba90, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff17c5f3a0) at kernel/qobject.cpp:3547
#15 0x00007fa5721acf49 in OrgKdeKglobalaccelComponentInterface::globalShortcutPressed (this=<optimized out>, _t1=..., _t2=..., _t3=6744479) at kglobalaccel_component_interface.moc:164
#16 0x00007fa5721ad3b4 in qt_static_metacall (_a=<optimized out>, _id=<optimized out>, _o=<optimized out>, _c=<optimized out>) at kglobalaccel_component_interface.moc:75
#17 OrgKdeKglobalaccelComponentInterface::qt_static_metacall (_o=0x165ba90, _c=<optimized out>, _id=<optimized out>, _a=0x7fff17c5f6f0) at kglobalaccel_component_interface.moc:69
#18 0x00007fa5721ada1f in OrgKdeKglobalaccelComponentInterface::qt_metacall (this=0x165ba90, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fff17c5f6f0) at kglobalaccel_component_interface.moc:130
#19 0x00007fa56dd0ced3 in QDBusConnectionPrivate::deliverCall (this=0x14a3650, object=0x165ba90, msg=..., metaTypes=..., slotIdx=5) at qdbusintegrator.cpp:947
#20 0x00007fa56d9a643e in QObject::event (this=0x165ba90, e=<optimized out>) at kernel/qobject.cpp:1195
#21 0x00007fa56cd38e9c in QApplicationPrivate::notify_helper (this=this@entry=0x14adaf0, receiver=receiver@entry=0x165ba90, e=e@entry=0x21355e0) at kernel/qapplication.cpp:4562
#22 0x00007fa56cd3d30a in QApplication::notify (this=0x7fff17c603f0, receiver=0x165ba90, e=0x21355e0) at kernel/qapplication.cpp:4423
#23 0x00007fa572069636 in KApplication::notify (this=0x7fff17c603f0, receiver=0x165ba90, event=0x21355e0) at ../../kdeui/kernel/kapplication.cpp:311
#24 0x00007fa56d99156e in QCoreApplication::notifyInternal (this=0x7fff17c603f0, receiver=receiver@entry=0x165ba90, event=event@entry=0x21355e0) at kernel/qcoreapplication.cpp:915
#25 0x00007fa56d9953f1 in sendEvent (event=0x21355e0, receiver=0x165ba90) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#26 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x143f1f0) at kernel/qcoreapplication.cpp:1539
#27 0x00007fa56cdde89c in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#28 QEventDispatcherX11::processEvents (this=0x1440ad0, flags=...) at kernel/qeventdispatcher_x11.cpp:75
#29 0x00007fa56d9902bf in QEventLoop::processEvents (this=this@entry=0x7fff17c60100, flags=...) at kernel/qeventloop.cpp:149
#30 0x00007fa56d990548 in QEventLoop::exec (this=0x7fff17c60100, flags=...) at kernel/qeventloop.cpp:204
#31 0x00007fa56d995708 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#32 0x00007fa5728aed5a in kdemain (argc=3, argv=0x7fff17c60538) at ../../kwin/main.cpp:537
#33 0x00007fa5724a976d in __libc_start_main (main=0x4006a0 <main(int, char**)>, argc=3, ubp_av=0x7fff17c60538, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff17c60528) at libc-start.c:226
#34 0x00000000004006d1 in _start ()

Reported using DrKonqi
Comment 1 Martin Flöser 2013-02-08 13:09:59 UTC
Git commit 47ccc07440ea28d4a35153ca06d2c467eed57c1d by Martin Gräßlin.
Committed on 07/02/2013 at 12:18.
Pushed by graesslin into branch 'KDE/4.10'.

Do not activate InvertEffect per window if there is no active window
FIXED-IN: 4.10.1
REVIEW: 108828

M  +3    -0    kwin/effects/invert/invert.cpp

http://commits.kde.org/kde-workspace/47ccc07440ea28d4a35153ca06d2c467eed57c1d