Bug 347490 - Crash when opening dialog windows (KWin::Workspace::desktopPresenceChanged)
Summary: Crash when opening dialog windows (KWin::Workspace::desktopPresenceChanged)
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: git master
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL: https://git.reviewboard.kde.org/r/123...
Keywords:
: 348200 378691 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-05-09 21:58 UTC by Luca Beltrame
Modified: 2017-04-12 18:20 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
mgraesslin: ReviewRequest+


Attachments
Crash backtrace (4.89 KB, text/plain)
2015-05-09 21:59 UTC, Luca Beltrame
Details
Supporting information (5.46 KB, text/plain)
2015-05-09 22:01 UTC, Luca Beltrame
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Beltrame 2015-05-09 21:58:31 UTC
Since yesterday's git (2015-05-08), KWin can crash when dialog windows are about to be displayed. The crash is not 100%, it occurs from 40 to 50% of the times, and is triggered by windows like KWallet's password prompt, or the file picker. 

This issue has been observed with the Intel and the Radeon FOSS drivers, at least, on recent Mesa. I'm unsure it's due to them, though. I also checked with both GLX and EGL, and either of them also causes the crash.

Backtrace and supporting information are attached.

Reproducible: Sometimes

Steps to Reproduce:
1. Open Kate
2. Trigger the file dialog, for example for opening a file

The above is not sufficient to trigger the crash 100% of the times, in fact often more tries are required.

Actual Results:  
KWin crashes

Expected Results:  
KWIn does not crash.
Comment 1 Luca Beltrame 2015-05-09 21:59:58 UTC
Created attachment 92516 [details]
Crash backtrace

Application: KWin (kwin_x11), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f96f04c8900 (LWP 19074))]

Thread 4 (Thread 0x7f96c7104700 (LWP 19079)):
#0  0x00007f96efe6aae3 in select () at /lib64/libc.so.6
#1  0x00007f96edd16c49 in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timespec const*) () at /usr/lib64/libQt5Core.so.5
#2  0x00007f96edd18563 in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timespec*) () at /usr/lib64/libQt5Core.so.5
#3  0x00007f96edd189cb in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#4  0x00007f96edcc140b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#5  0x00007f96edae3e4a in QThread::exec() () at /usr/lib64/libQt5Core.so.5
#6  0x00007f96e8322138 in  () at /usr/lib64/libQt5Qml.so.5
#7  0x00007f96edae8a7f in  () at /usr/lib64/libQt5Core.so.5
#8  0x00007f96ef724484 in start_thread () at /lib64/libpthread.so.0
#9  0x00007f96efe71a4d in clone () at /lib64/libc.so.6

Thread 3 (Thread 0x7f96bb810700 (LWP 19080)):
#0  0x00007f96ef72891f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f96c5b31073 in  () at /usr/lib64/dri/r600_dri.so
#2  0x00007f96c5b30927 in  () at /usr/lib64/dri/r600_dri.so
#3  0x00007f96ef724484 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f96efe71a4d in clone () at /lib64/libc.so.6

Thread 2 (Thread 0x7f96ba454700 (LWP 19082)):
#0  0x00007f96ef72891f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f96ecae747b in  () at /usr/lib64/libQt5Script.so.5
#2  0x00007f96ecae74a9 in  () at /usr/lib64/libQt5Script.so.5
#3  0x00007f96ef724484 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f96efe71a4d in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7f96f04c8900 (LWP 19074)):
[KCrash Handler]
#5  0x00007f96efa6e70b in QtPrivate::QFunctorSlotObject<KWin::EffectsHandlerImpl::EffectsHandlerImpl(KWin::Compositor*, KWin::Scene*)::__lambda19, 2, QtPrivate::List<KWin::AbstractClient*, int>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (old=<optimized out>, c=<optimized out>, __closure=<optimized out>) at /usr/src/debug/kwin-5.3.91git~20150508T131904~af134db/effects.cpp:238
#6  0x00007f96efa6e70b in QtPrivate::QFunctorSlotObject<KWin::EffectsHandlerImpl::EffectsHandlerImpl(KWin::Compositor*, KWin::Scene*)::__lambda19, 2, QtPrivate::List<KWin::AbstractClient*, int>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (arg=<optimized out>, f=...) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:494
#7  0x00007f96efa6e70b in QtPrivate::QFunctorSlotObject<KWin::EffectsHandlerImpl::EffectsHandlerImpl(KWin::Compositor*, KWin::Scene*)::__lambda19, 2, QtPrivate::List<KWin::AbstractClient*, int>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (arg=<optimized out>, f=...) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:551
#8  0x00007f96efa6e70b in QtPrivate::QFunctorSlotObject<KWin::EffectsHandlerImpl::EffectsHandlerImpl(KWin::Compositor*, KWin::Scene*)::__lambda19, 2, QtPrivate::List<KWin::AbstractClient*, int>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=51397808, this_=0x2f46fe0, r=0x2f40b20, a=0x7ffc1aafa9f0, ret=0x0) at /usr/include/qt5/QtCore/qobject_impl.h:192
#9  0x00007f96edcf278f in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib64/libQt5Core.so.5
#10 0x00007f96efaee820 in KWin::Workspace::desktopPresenceChanged(KWin::AbstractClient*, int) (this=<optimized out>, _t1=0x31044b0, _t2=0) at /usr/src/debug/kwin-5.3.91git~20150508T131904~af134db/build/moc_workspace.cpp:658
#11 0x00007f96edcf3b66 in QObject::event(QEvent*) () at /usr/lib64/libQt5Core.so.5
#12 0x00007f96ee982aec in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#13 0x00007f96ee987940 in QApplication::notify(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#14 0x00007f96edcc34b5 in QCoreApplication::notifyInternal(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#15 0x00007f96edcc534f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib64/libQt5Core.so.5
#16 0x00007f96edd18954 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#17 0x00007f96d8567ffd in  () at /usr/lib64/qt5/plugins/platforms/libqxcb.so
#18 0x00007f96edcc140b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#19 0x00007f96edcc8a96 in QCoreApplication::exec() () at /usr/lib64/libQt5Core.so.5
#20 0x00007f96f0130664 in kdemain(int, char**) (argc=2, argv=0x7ffc1aafb118) at /usr/src/debug/kwin-5.3.91git~20150508T131904~af134db/main_x11.cpp:302
#21 0x00007f96efdab8c5 in __libc_start_main () at /lib64/libc.so.6
#22 0x00000000004008b9 in _start () at ../sysdeps/x86_64/start.S:118
Comment 2 Luca Beltrame 2015-05-09 22:01:14 UTC
Created attachment 92517 [details]
Supporting information
Comment 3 Elias Probst 2015-05-10 07:55:34 UTC
Same here on Intel IvyBridge (full kwin SupportInformation below).
I was only able so far to trigger this crash with Kate's file dialog and only after working for a few minutes in other applications, but strangely never directly after launching Kate.
Couldn't figure out a clear pattern to reproduce this crash yet.

Application: KWin (kwin_x11), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f1463bad880 (LWP 23645))]

Thread 3 (Thread 0x7f1444a16700 (LWP 23662)):
#0  0x00007f14636c6dc3 in select () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f1461d9be19 in qt_safe_select (nfds=15, fdread=0x7f1438000a78, fdwrite=0x7f1438000d08, fdexcept=0x7f1438000f98, orig_timeout=0x0) at kernel/qcore_unix.cpp:75
#2  0x00007f1461d9d795 in QEventDispatcherUNIXPrivate::doSelect (this=this@entry=0x7f14380008e0, flags=..., flags@entry=..., timeout=0x0) at kernel/qeventdispatcher_unix.cpp:196
#3  0x00007f1461d9dbdb in QEventDispatcherUNIX::processEvents (this=0x7f14380008c0, flags=...) at kernel/qeventdispatcher_unix.cpp:607
#4  0x00007f1461d4664b in QEventLoop::exec (this=this@entry=0x7f1444a15d30, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#5  0x00007f1461b6a90a in QThread::exec (this=this@entry=0x264bdc0) at thread/qthread.cpp:503
#6  0x00007f145c220ba8 in QQmlThreadPrivate::run (this=0x264bdc0) at qml/ftw/qqmlthread.cpp:141
#7  0x00007f1461b6f52f in QThreadPrivate::start (arg=0x264bdc0) at thread/qthread_unix.cpp:337
#8  0x00007f1462f85204 in start_thread (arg=0x7f1444a16700) at pthread_create.c:310
#9  0x00007f14636cdcfd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7f143cd05700 (LWP 23666)):
#0  pthread_cond_wait () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f146099dfbb in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0x7f1460a8ac60 <QTWTF::pageheap_memory>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#2  0x00007f146099dfe9 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=<optimized out>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#3  0x00007f1462f85204 in start_thread (arg=0x7f143cd05700) at pthread_create.c:310
#4  0x00007f14636cdcfd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7f1463bad880 (LWP 23645)):
[KCrash Handler]
#6  0x0000000000016e09 in ?? ()
#7  0x00007f14632cb8b1 in operator() (old=<optimized out>, c=<optimized out>, __closure=<optimized out>) at /var/tmp/portage/kde-plasma/kwin-9999/work/kwin-9999/effects.cpp:238
#8  call (arg=<optimized out>, f=...) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:494
#9  call<QtPrivate::List<KWin::AbstractClient*, int>, void> (arg=<optimized out>, f=...) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:551
#10 QtPrivate::QFunctorSlotObject<KWin::EffectsHandlerImpl::EffectsHandlerImpl(KWin::Compositor*, KWin::Scene*)::__lambda19, 2, QtPrivate::List<KWin::AbstractClient*, int>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=44588624, this_=0x37418d0, r=0x3bbdb50, a=0x7ffdd638b300, ret=0x0) at /usr/include/qt5/QtCore/qobject_impl.h:192
#11 0x00007f1461d779df in call (a=0x7ffdd638b300, r=0x3bbdb50, this=0x37418d0) at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:124
#12 QMetaObject::activate (sender=0x2493ce0, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffdd638b300) at kernel/qobject.cpp:3702
#13 0x00007f1461d78587 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f14635de5c0 <KWin::Workspace::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffdd638b300) at kernel/qobject.cpp:3582
#14 0x00007f1463349aa0 in KWin::Workspace::desktopPresenceChanged (this=<optimized out>, _t1=0x2a85e50, _t2=0) at /var/tmp/portage/kde-plasma/kwin-9999/work/kwin-9999_build/moc_workspace.cpp:658
#15 0x00007f1461d78d66 in QObject::event (this=0x2493ce0, e=<optimized out>) at kernel/qobject.cpp:1245
#16 0x00007f146260288c in QApplicationPrivate::notify_helper (this=this@entry=0x23940b0, receiver=receiver@entry=0x2493ce0, e=e@entry=0x2a84eb0) at kernel/qapplication.cpp:3720
#17 0x00007f1462607756 in QApplication::notify (this=0x7ffdd638b8d0, receiver=0x2493ce0, e=0x2a84eb0) at kernel/qapplication.cpp:3503
#18 0x00007f1461d486f5 in QCoreApplication::notifyInternal (this=0x7ffdd638b8d0, receiver=0x2493ce0, event=event@entry=0x2a84eb0) at kernel/qcoreapplication.cpp:935
#19 0x00007f1461d4a58f in sendEvent (event=0x2a84eb0, receiver=<optimized out>) at kernel/qcoreapplication.h:228
#20 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x23845a0) at kernel/qcoreapplication.cpp:1552
#21 0x00007f1461d9db64 in QEventDispatcherUNIX::processEvents (this=0x23c15b0, flags=flags@entry=...) at kernel/qeventdispatcher_unix.cpp:579
#22 0x00007f144de3526d in QUnixEventDispatcherQPA::processEvents (this=<optimized out>, flags=...) at eventdispatchers/qunixeventdispatcher.cpp:62
#23 0x00007f1461d4664b in QEventLoop::exec (this=this@entry=0x7ffdd638b800, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#24 0x00007f1461d4dcd6 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1188
#25 0x00007f1462070b5c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1507
#26 0x00007f14625fef65 in QApplication::exec () at kernel/qapplication.cpp:2956
#27 0x00007f14639881e4 in kdemain (argc=3, argv=0x7ffdd638ba28) at /var/tmp/portage/kde-plasma/kwin-9999/work/kwin-9999/main_x11.cpp:302
#28 0x00007f1463607b55 in __libc_start_main (main=0x400810 <main(int, char**)>, argc=3, argv=0x7ffdd638ba28, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffdd638ba18) at libc-start.c:289
#29 0x000000000040083e in _start ()





KWin supportInformation:
KWin Support Information:
The following information should be used when requesting support on e.g. http://forum.kde.org.
It provides information about the currently running instance, which options are used,
what OpenGL driver and which effects are running.
Please post the information provided underneath this introductory text to a paste bin service
like http://paste.kde.org instead of pasting into support threads.

==========================

Version
=======
KWin version: 5.3.90
Qt Version: 5.4.1
Qt compile version: 5.4.1
XCB compile version: 1.11

Operation Mode: X11 only

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_WAYLAND: yes
HAVE_WAYLAND_EGL: yes
HAVE_WAYLAND_CURSOR: yes
HAVE_XKB: yes
HAVE_INPUT: no
HAVE_DRM: yes
HAVE_GBM: yes
HAVE_XCB_CURSOR: yes
HAVE_XCB_SYNC: yes
HAVE_X11_XCB: yes

X11
===
Vendor: The X.Org Foundation
Vendor Release: 11701000
Protocol Version/Revision: 11/0
SHAPE: yes; Version: 0x11
RANDR: yes; Version: 0x14
DAMAGE: yes; Version: 0x11
Composite: yes; Version: 0x4
RENDER: yes; Version: 0xb
XFIXES: yes; Version: 0x50
SYNC: yes; Version: 0x31
GLX: yes; Version: 0x0

Decoration
==========
Plugin: org.kde.breeze
Theme: 
Blur: 0
onAllDesktopsAvailable: true
alphaChannelSupported: true
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 0, 2, 9
decorationButtonsRight: 6, 3, 4, 5
borderSize: 3
gridUnit: 10
font: Oxygen-Sans,10,-1,0,50,0,0,0,0,0
smallSpacing: 2
largeSpacing: 10

Options
=======
focusPolicy: 1
nextFocusPrefersMouse: true
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
placement: 4
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: true
focusStealingPreventionLevel: 1
legacyFullscreenSupport: false
operationTitlebarDblClick: 5000
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: 0
commandActiveTitlebar2: 30
commandActiveTitlebar3: 2
commandInactiveTitlebar1: 4
commandInactiveTitlebar2: 30
commandInactiveTitlebar3: 2
commandWindow1: 7
commandWindow2: 8
commandWindow3: 8
commandWindowWheel: 31
commandAll1: 10
commandAll2: 3
commandAll3: 14
keyCmdAllModKey: 16777250
showGeometryTip: true
condensedTitle: false
electricBorderMaximize: true
electricBorderTiling: true
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
inactiveTabsSkipTaskbar: false
autogroupSimilarWindows: false
autogroupInForeground: true
compositingMode: 1
useCompositing: true
compositingInitialized: true
hiddenPreviews: 1
unredirectFullscreen: false
glSmoothScale: 2
colorCorrected: false
xrenderSmoothScale: false
maxFpsInterval: 16666666
refreshRate: 0
vBlankTime: 6000000
glStrictBinding: true
glStrictBindingFollowsDriver: true
glCoreProfile: false
glPreferBufferSwap: 101
glPlatformInterface: 1

Screen Edges
============
desktopSwitching: false
desktopSwitchingMovingClients: false
cursorPushBackDistance: 1x1
timeThreshold: 150
reActivateThreshold: 350
actionTopLeft: 0
actionTop: 0
actionTopRight: 0
actionRight: 0
actionBottomRight: 4
actionBottom: 0
actionBottomLeft: 0
actionLeft: 0

Screens
=======
Multi-Head: no
Active screen follows mouse:  no
Number of Screens: 2
Screen 0 Geometry: 320,1440,1920x1080
Screen 1 Geometry: 0,0,2560x1440

Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile 
OpenGL version string: 3.0 Mesa 10.6.0-devel (git-da136dc)
OpenGL platform interface: GLX
OpenGL shading language version string: 1.30
Driver: Intel
GPU class: IvyBridge
OpenGL version: 3.0
GLSL version: 1.30
Mesa version: 10.6
X server version: 1.17.1
Linux kernel version: 4.0.1
Direct rendering: Requires strict binding: yes
GLSL shaders:  yes
Texture NPOT support:  yes
Virtual Machine:  no
OpenGL 2 Shaders are used
Painting blocks for vertical retrace:  no

Loaded Effects:
---------------
zoom
slidingpopups
kwin4_effect_login
slide
screenshot
kwin4_effect_translucency
minimizeanimation
kwin4_effect_eyeonscreen
desktopgrid
kwin4_effect_windowaperture
kwin4_effect_fade
kwin4_effect_maximize
presentwindows
kwin4_effect_dialogparent
highlightwindow
blur
contrast
logout
dashboard
windowgeometry
startupfeedback
screenedge
kscreen

Currently Active Effects:
-------------------------
blur
contrast

Effect Settings:
----------------
zoom:
zoomFactor: 1.2
mousePointer: 0
mouseTracking: 0
enableFocusTracking: false
followFocus: true
focusDelay: 350
moveFactor: 20
targetZoom: 1

slidingpopups:
fadeInTime: 150
fadeOutTime: 250

kwin4_effect_login:

slide:

screenshot:

kwin4_effect_translucency:

minimizeanimation:

kwin4_effect_eyeonscreen:

desktopgrid:
zoomDuration: 300
border: 10
desktopNameAlignment: 0
layoutMode: 1
customLayoutRows: 2
usePresentWindows: true

kwin4_effect_windowaperture:

kwin4_effect_fade:

kwin4_effect_maximize:

presentwindows:
layoutMode: 0
showCaptions: true
showIcons: true
doNotCloseWindows: false
ignoreMinimized: false
accuracy: 20
fillGaps: true
fadeDuration: 150
showPanel: false
leftButtonWindow: 1
rightButtonWindow: 2
middleButtonWindow: 4
leftButtonDesktop: 2
middleButtonDesktop: 0
rightButtonDesktop: 0

kwin4_effect_dialogparent:

highlightwindow:

blur:
blurRadius: 12
cacheTexture: true

contrast:

logout:
useBlur: true

dashboard:
brightness: 0.5
saturation: 0.5
blur: false

windowgeometry:
handlesMoves: true
handlesResizes: true

startupfeedback:
type: 1

screenedge:

kscreen:
Comment 4 Martin Flöser 2015-05-11 06:53:39 UTC
thanks for the backtrace. Will put it on my high ASAP list.
Comment 5 Martin Flöser 2015-05-11 07:15:52 UTC
That's a quite interesting issue. The code hardly changed:
* signal carries AbstractClient* instead of Client* as argument
* connect in Workspace got changed to new compiled syntax

The interesting aspect about the signal is that it is a queued connection. My assumption is that the passed in argument gets deleted while the signal is executed and that this worked by poor chance in the previous version (memory not overwritten), but now it crashes due to the involved cast. Does that sound somewhat sane?
Comment 6 Luca Beltrame 2015-05-11 07:23:10 UTC
I have no knowledge of the KWin internals, but at least such an explanation takes into account the fact that it never occurs 100% of the time.
Comment 7 Martin Flöser 2015-05-12 08:07:28 UTC
Possible fix:
diff --git a/workspace.cpp b/workspace.cpp
index 2d5ece1..2b28838 100644
--- a/workspace.cpp
+++ b/workspace.cpp
@@ -466,7 +466,7 @@ Client* Workspace::createClient(xcb_window_t w, bool is_mapped)
     connect(c, SIGNAL(geometryShapeChanged(KWin::Toplevel*,QRect)), m_compositor, SLOT(checkUnredirect()));
     connect(c, SIGNAL(blockingCompositingChanged(KWin::Client*)), m_compositor, SLOT(updateCompositeBlocking(KWin::Client*)));
     connect(c, SIGNAL(clientFullScreenSet(KWin::Client*,bool,bool)), ScreenEdges::self(), SIGNAL(checkBlocking()));
-    connect(c, &Client::desktopPresenceChanged, this, &Workspace::desktopPresenceChanged, Qt::QueuedConnection);
+    connect(c, &Client::desktopPresenceChanged, this, &Workspace::desktopPresenceChanged);
     if (!c->manage(w, is_mapped)) {
         Client::deleteClient(c);
         return NULL;


@Thomas: do you remember why you used a Qt::QueuedConnection for that signal?
Comment 8 Thomas Lübking 2015-05-12 08:25:38 UTC
I *think* to move the signal behind the visibility update (for the effects, not sure whether it caused occasional graphical glitches)
Comment 9 Martin Flöser 2015-05-12 08:33:15 UTC
hmm that means we could move the queuing into effectshandler. The EffectWindow is also valid after the Client got deleted, so queuing to the end of the event cycle should be possible.
Comment 10 Martin Flöser 2015-05-12 09:35:57 UTC
Please try the patch in https://git.reviewboard.kde.org/r/123729/
Comment 11 Martin Flöser 2015-05-18 06:03:17 UTC
Git commit 30e6ae34d7ed24500d68e2ce00f28b3b2966f2af by Martin Gräßlin.
Committed on 18/05/2015 at 06:01.
Pushed by graesslin into branch 'master'.

Delay desktopPresenceChanged in EffectsHandlerImpl instead of Workspace

The signal might be emited by Workspace just before a Client gets
destroyed. In that case the argument carried by the queued event is no
longer valid and causes problems. In EffectsHandlerImpl we can queue
it without problems as the EffectWindow also stays valid if the Client
gets destroyed. The referenced Deleted gets destroyed with a deleteLater,
thus will be after the signal is emitted.
REVIEW: 123729

M  +5    -1    effects.cpp
M  +1    -1    workspace.cpp

http://commits.kde.org/kwin/30e6ae34d7ed24500d68e2ce00f28b3b2966f2af
Comment 12 Martin Flöser 2016-08-29 07:19:27 UTC
*** Bug 348200 has been marked as a duplicate of this bug. ***
Comment 13 Martin Flöser 2017-04-12 18:20:38 UTC
*** Bug 378691 has been marked as a duplicate of this bug. ***