Bug 419728

Summary: kwin_wayland crashes when external monitor is disconnected from hdmi port while multi-monitor mode is set to "Switch to external screen"
Product: [Plasma] kwin Reporter: Patrick Silva <bugseforuns>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: andrius, flateric, kde-bugs, kde, kode54, Lukas, nate, postix
Priority: VHI Flags: postix: Wayland+
Version: git master   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=427827
https://bugs.kde.org/show_bug.cgi?id=415240
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Backtrace 1 (SIGSEV)

Description Patrick Silva 2020-04-06 15:12:06 UTC
STEPS TO REPRODUCE
1. start Wayland session
2. connect an external monitor to hdmi port and turn it on
3. set multi-monitor mode to "Switch to external screen"
4. disconnect the cable from hdmi port

OBSERVED RESULT
laptop screen is reactivated but kwin_wayland crashes immediately.

EXPECTED RESULT
no crash

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.18.80
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.1
Comment 1 Patrick Silva 2020-04-06 15:12:40 UTC
Thread 13 (Thread 1111.3352):
#0  0x00007f3e6dc01ed9 in futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7f3e45ac9bf0, expected=0, futex_word=0x55d5628bdab0)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:142
#1  __pthread_cond_wait_common (abstime=0x7f3e45ac9ca0, mutex=0x55d5628bda60, cond=0x55d5628bda88) at pthread_cond_wait.c:533
#2  __pthread_cond_timedwait (cond=cond@entry=0x55d5628bda88, mutex=mutex@entry=0x55d5628bda60, abstime=abstime@entry=0x7f3e45ac9ca0) at pthread_cond_wait.c:667
#3  0x00007f3e6c544d2a in QWaitConditionPrivate::wait_relative (this=0x55d5628bda60, deadline=...) at thread/qwaitcondition_unix.cpp:136
#4  QWaitConditionPrivate::wait (deadline=..., this=0x55d5628bda60) at thread/qwaitcondition_unix.cpp:144
#5  QWaitCondition::wait (this=<optimized out>, mutex=0x55d5628bd928, deadline=...) at thread/qwaitcondition_unix.cpp:225
#6  0x00007f3e6c544ee6 in QWaitCondition::wait (this=this@entry=0x55d562bca090, mutex=mutex@entry=0x55d5628bd928, time=<optimized out>)
    at thread/qwaitcondition_unix.cpp:209
#7  0x00007f3e6c542275 in QThreadPoolThread::run (this=0x55d562bca080) at thread/qthreadpool.cpp:139
#8  0x00007f3e6c53e7ec in QThreadPrivate::start (arg=0x55d562bca080) at thread/qthread_unix.cpp:342
#9  0x00007f3e6dbfb6db in start_thread (arg=0x7f3e45aca700) at pthread_create.c:463
#10 0x00007f3e6bc0b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 12 (Thread 1111.3351):
#0  0x00007f3e6dc01ed9 in futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7f3e25929bf0, expected=0, futex_word=0x55d563367fe4)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:142
#1  __pthread_cond_wait_common (abstime=0x7f3e25929ca0, mutex=0x55d563367f90, cond=0x55d563367fb8) at pthread_cond_wait.c:533
#2  __pthread_cond_timedwait (cond=cond@entry=0x55d563367fb8, mutex=mutex@entry=0x55d563367f90, abstime=abstime@entry=0x7f3e25929ca0) at pthread_cond_wait.c:667
#3  0x00007f3e6c544d2a in QWaitConditionPrivate::wait_relative (this=0x55d563367f90, deadline=...) at thread/qwaitcondition_unix.cpp:136
#4  QWaitConditionPrivate::wait (deadline=..., this=0x55d563367f90) at thread/qwaitcondition_unix.cpp:144
#5  QWaitCondition::wait (this=<optimized out>, mutex=0x55d5628bd928, deadline=...) at thread/qwaitcondition_unix.cpp:225
#6  0x00007f3e6c544ee6 in QWaitCondition::wait (this=this@entry=0x55d56332e9a0, mutex=mutex@entry=0x55d5628bd928, time=<optimized out>)
    at thread/qwaitcondition_unix.cpp:209
#7  0x00007f3e6c542275 in QThreadPoolThread::run (this=0x55d56332e990) at thread/qthreadpool.cpp:139
#8  0x00007f3e6c53e7ec in QThreadPrivate::start (arg=0x55d56332e990) at thread/qthread_unix.cpp:342
#9  0x00007f3e6dbfb6db in start_thread (arg=0x7f3e2592a700) at pthread_create.c:463
#10 0x00007f3e6bc0b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 11 (Thread 1111.1167):
#0  0x00007f3e6dc019f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7f3e6b7c9fb8 <QTWTF::pageheap_memory+57592>)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x7f3e6b7c9f68 <QTWTF::pageheap_memory+57512>, cond=0x7f3e6b7c9f90 <QTWTF::pageheap_memory+57552>)
    at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=cond@entry=0x7f3e6b7c9f90 <QTWTF::pageheap_memory+57552>, mutex=mutex@entry=0x7f3e6b7c9f68 <QTWTF::pageheap_memory+57512>)
    at pthread_cond_wait.c:655
#3  0x00007f3e6b4d4944 in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0x7f3e6b7bbec0 <QTWTF::pageheap_memory>)
    at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#4  0x00007f3e6b4d4989 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=<optimized out>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#5  0x00007f3e6dbfb6db in start_thread (arg=0x7f3e24928700) at pthread_create.c:463
#6  0x00007f3e6bc0b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 10 (Thread 1111.1166):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f3e6c540d44 in QtLinuxFutex::_q_futex (val3=0, addr2=0x0, val2=0, val=<optimized out>, op=0, addr=<optimized out>) at thread/qfutex_p.h:116
#2  QtLinuxFutex::futexWait<QBasicAtomicInteger<unsigned int> > (expectedValue=<optimized out>, futex=...) at thread/qfutex_p.h:135
#3  futexSemaphoreTryAcquire_loop<false> (timeout=-1, nn=8589934593, curValue=<optimized out>, u=...) at thread/qsemaphore.cpp:219
#4  futexSemaphoreTryAcquire<false> (timeout=-1, n=n@entry=1, u=...) at thread/qsemaphore.cpp:262
#5  QSemaphore::acquire (this=this@entry=0x55d5634657f0, n=n@entry=1) at thread/qsemaphore.cpp:326
#6  0x00007f3e55fa0d7a in QtVirtualKeyboard::HunspellWorker::run (this=0x55d5634657d0) at hunspellworker.cpp:744
#7  0x00007f3e6c53e7ec in QThreadPrivate::start (arg=0x55d5634657d0) at thread/qthread_unix.cpp:342
#8  0x00007f3e6dbfb6db in start_thread (arg=0x7f3e25129700) at pthread_create.c:463
#9  0x00007f3e6bc0b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 9 (Thread 1111.1164):
#0  0x00007f3e6dc019f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55d563369640) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x55d5633695f0, cond=0x55d563369618) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=cond@entry=0x55d563369618, mutex=mutex@entry=0x55d5633695f0) at pthread_cond_wait.c:655
#3  0x00007f3e6c544d9b in QWaitConditionPrivate::wait (deadline=..., this=0x55d5633695f0) at thread/qwaitcondition_unix.cpp:146
#4  QWaitCondition::wait (this=<optimized out>, mutex=0x55d563369458, deadline=...) at thread/qwaitcondition_unix.cpp:225
#5  0x00007f3e6c544f19 in QWaitCondition::wait (this=this@entry=0x55d563369460, mutex=mutex@entry=0x55d563369458, time=time@entry=18446744073709551615)
    at thread/qwaitcondition_unix.cpp:208
#6  0x00007f3e279e78eb in FileInfoThread::run (this=0x55d563369448) at fileinfothread.cpp:231
#7  0x00007f3e6c53e7ec in QThreadPrivate::start (arg=0x55d563369448) at thread/qthread_unix.cpp:342
#8  0x00007f3e6dbfb6db in start_thread (arg=0x7f3e2612b700) at pthread_create.c:463
#9  0x00007f3e6bc0b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 8 (Thread 1111.1163):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f3e6c540d44 in QtLinuxFutex::_q_futex (val3=0, addr2=0x0, val2=0, val=<optimized out>, op=0, addr=<optimized out>) at thread/qfutex_p.h:116
#2  QtLinuxFutex::futexWait<QBasicAtomicInteger<unsigned int> > (expectedValue=<optimized out>, futex=...) at thread/qfutex_p.h:135
#3  futexSemaphoreTryAcquire_loop<false> (timeout=-1, nn=8589934593, curValue=<optimized out>, u=...) at thread/qsemaphore.cpp:219
#4  futexSemaphoreTryAcquire<false> (timeout=-1, n=n@entry=1, u=...) at thread/qsemaphore.cpp:262
#5  QSemaphore::acquire (this=this@entry=0x55d563373e60, n=n@entry=1) at thread/qsemaphore.cpp:326
#6  0x00007f3e55fa0d7a in QtVirtualKeyboard::HunspellWorker::run (this=0x55d563373e40) at hunspellworker.cpp:744
#7  0x00007f3e6c53e7ec in QThreadPrivate::start (arg=0x55d563373e40) at thread/qthread_unix.cpp:342
#8  0x00007f3e6dbfb6db in start_thread (arg=0x7f3e2692c700) at pthread_create.c:463
#9  0x00007f3e6bc0b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 7 (Thread 1111.1162):
#0  0x00007f3e6bbfebf9 in __GI___poll (fds=0x7f3e280029e0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f3e62fe05c9 in ?? () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f3e62fe06dc in g_main_context_iteration () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f3e6c78d0bc in QEventDispatcherGlib::processEvents (this=0x7f3e28000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007f3e6c72c63a in QEventLoop::exec (this=this@entry=0x7f3e2ee34d80, flags=..., flags@entry=...) at kernel/qeventloop.cpp:225
#5  0x00007f3e6c53d317 in QThread::exec (this=this@entry=0x55d56316d870) at thread/qthread.cpp:536
#6  0x00007f3e67932605 in QQmlThreadPrivate::run (this=0x55d56316d870) at qml/ftw/qqmlthread.cpp:155
#7  0x00007f3e6c53e7ec in QThreadPrivate::start (arg=0x55d56316d870) at thread/qthread_unix.cpp:342
#8  0x00007f3e6dbfb6db in start_thread (arg=0x7f3e2ee35700) at pthread_create.c:463
#9  0x00007f3e6bc0b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 6 (Thread 1111.1160):
#0  0x00007f3e6bbfebf9 in __GI___poll (fds=0x7f3e38002de0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f3e62fe05c9 in ?? () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f3e62fe06dc in g_main_context_iteration () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f3e6c78d0bc in QEventDispatcherGlib::processEvents (this=0x7f3e38000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007f3e6c72c63a in QEventLoop::exec (this=this@entry=0x7f3e44e0ed80, flags=..., flags@entry=...) at kernel/qeventloop.cpp:225
#5  0x00007f3e6c53d317 in QThread::exec (this=this@entry=0x55d562cf7d10) at thread/qthread.cpp:536
#6  0x00007f3e67932605 in QQmlThreadPrivate::run (this=0x55d562cf7d10) at qml/ftw/qqmlthread.cpp:155
#7  0x00007f3e6c53e7ec in QThreadPrivate::start (arg=0x55d562cf7d10) at thread/qthread_unix.cpp:342
#8  0x00007f3e6dbfb6db in start_thread (arg=0x7f3e44e0f700) at pthread_create.c:463
#9  0x00007f3e6bc0b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 5 (Thread 1111.1132):
#0  0x00007f3e6dc019f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55d56286c968) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x55d56286c918, cond=0x55d56286c940) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x55d56286c940, mutex=0x55d56286c918) at pthread_cond_wait.c:655
#3  0x00007f3e4cd80ecb in ?? () from target:/usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007f3e4cd80ac7 in ?? () from target:/usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007f3e6dbfb6db in start_thread (arg=0x7f3e4767c700) at pthread_create.c:463
#6  0x00007f3e6bc0b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 1111.1131):
#0  0x00007f3e6bbfebf9 in __GI___poll (fds=0x7f3e400029e0, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f3e62fe05c9 in ?? () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f3e62fe06dc in g_main_context_iteration () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f3e6c78d0bc in QEventDispatcherGlib::processEvents (this=0x7f3e40000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007f3e6c72c63a in QEventLoop::exec (this=this@entry=0x7f3e4f7fdda0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:225
#5  0x00007f3e6c53d317 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:536
#6  0x00007f3e6c53e7ec in QThreadPrivate::start (arg=0x55d5627ac990) at thread/qthread_unix.cpp:342
#7  0x00007f3e6dbfb6db in start_thread (arg=0x7f3e4f7fe700) at pthread_create.c:463
#8  0x00007f3e6bc0b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 1111.1130):
#0  0x00007f3e6bbfebf9 in __GI___poll (fds=0x7f3e48002de0, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f3e62fe05c9 in ?? () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f3e62fe06dc in g_main_context_iteration () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f3e6c78d0bc in QEventDispatcherGlib::processEvents (this=0x7f3e48000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007f3e6c72c63a in QEventLoop::exec (this=this@entry=0x7f3e4fffeda0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:225
#5  0x00007f3e6c53d317 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:536
#6  0x00007f3e6c53e7ec in QThreadPrivate::start (arg=0x55d5627ab9c0) at thread/qthread_unix.cpp:342
#7  0x00007f3e6dbfb6db in start_thread (arg=0x7f3e4ffff700) at pthread_create.c:463
#8  0x00007f3e6bc0b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 1111.1129):
#0  0x00007f3e6bbfebf9 in __GI___poll (fds=0x7f3e5002a700, nfds=5, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f3e62fe05c9 in ?? () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f3e62fe06dc in g_main_context_iteration () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f3e6c78d0bc in QEventDispatcherGlib::processEvents (this=0x7f3e50000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007f3e6c72c63a in QEventLoop::exec (this=this@entry=0x7f3e55274d70, flags=..., flags@entry=...) at kernel/qeventloop.cpp:225
#5  0x00007f3e6c53d317 in QThread::exec (this=this@entry=0x7f3e6dbf2da0 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread.cpp:536
#6  0x00007f3e6d97a555 in QDBusConnectionManager::run (this=0x7f3e6dbf2da0 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:179
#7  0x00007f3e6c53e7ec in QThreadPrivate::start (arg=0x7f3e6dbf2da0 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:342
#8  0x00007f3e6dbfb6db in start_thread (arg=0x7f3e55275700) at pthread_create.c:463
#9  0x00007f3e6bc0b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 1111.1111):
#0  0x00000000000000f0 in ?? ()
#1  0x00007f3e54859108 in KWin::EglGbmBackend::setViewport (this=this@entry=0x55d5628ad770, output=...) at ./plugins/platforms/drm/egl_gbm_backend.cpp:479
#2  0x00007f3e548591ec in KWin::EglGbmBackend::prepareRenderingForScreen (this=0x55d5628ad770, screenId=<optimized out>) at ./plugins/platforms/drm/egl_gbm_backend.cpp:492
#3  0x00007f3e4e3de99b in KWin::SceneOpenGL::paint (this=0x55d5628b4320, damage=..., toplevels=...) at ./plugins/scenes/opengl/scene_opengl.cpp:638
#4  0x00007f3e6f1b0dbe in KWin::Compositor::performCompositing (this=0x55d5628a9e40) at ./composite.cpp:692
#5  0x00007f3e6c760df3 in QObject::event (this=0x55d5628a9e40, e=0x7fff14378da0) at kernel/qobject.cpp:1361
#6  0x00007f3e6cd618bc in QApplicationPrivate::notify_helper (this=this@entry=0x55d562754c80, receiver=receiver@entry=0x55d5628a9e40, e=e@entry=0x7fff14378da0)
    at kernel/qapplication.cpp:3684
#7  0x00007f3e6cd68ac0 in QApplication::notify (this=0x7fff143791c0, receiver=0x55d5628a9e40, e=0x7fff14378da0) at kernel/qapplication.cpp:3430
#8  0x00007f3e6c72ddb8 in QCoreApplication::notifyInternal2 (receiver=0x55d5628a9e40, event=0x7fff14378da0) at kernel/qcoreapplication.cpp:1092
#9  0x00007f3e6c78c549 in QTimerInfoList::activateTimers (this=this@entry=0x55d562763fa8) at kernel/qtimerinfo_unix.cpp:643
#10 0x00007f3e6c789a0c in QEventDispatcherUNIXPrivate::activateTimers (this=this@entry=0x55d562763f20) at kernel/qeventdispatcher_unix.cpp:249
#11 0x00007f3e6c78a88a in QEventDispatcherUNIX::processEvents (this=<optimized out>, flags=...) at kernel/qeventdispatcher_unix.cpp:514
#12 0x00007f3e584a7c2d in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from target:/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/KWinQpaPlugin.so
#13 0x00007f3e6c72c63a in QEventLoop::exec (this=this@entry=0x7fff14378f60, flags=..., flags@entry=...) at kernel/qeventloop.cpp:225
#14 0x00007f3e6c735db0 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1400
#15 0x000055d5615ae0df in main (argc=<optimized out>, argv=<optimized out>) at ./main_wayland.cpp:679
Comment 2 postix 2020-09-01 13:52:09 UTC
*** Bug 426056 has been marked as a duplicate of this bug. ***
Comment 3 Lukas Spies 2020-09-23 03:13:45 UTC
kwin_wayland crashes for me also when multi-monitor mode is set to extend the desktop to the second screen. Unplugging the HDMI connection immediately crashes kwin_wayland.

Operating System: Arch Linux
KDE Plasma Version: 5.19.90
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1
Comment 4 postix 2020-10-15 11:44:31 UTC
Created attachment 132383 [details]
Backtrace 1 (SIGSEV)

I created a debug build of kwin v5.19.5 (on Manjaro) and ran

cd /opt/kwin/build/bin
export QT_PLUGIN_PATH=`pwd`
PLASMA_USE_QT_SCALING=1 XDG_SESSION_TYPE=wayland ./kwin_wayland --xwayland --exit-with-session=/usr/lib/startplasma-waylandsession

on a second machine I let gdb run via ssh. 

Then I plugged in a second monitor, disabled the laptop monitor via SystemSettings and finally plugged out the external monitor. This let to the  SIGSEV in the attached file.

I hope this helps. ;)
Comment 5 Lukas Spies 2020-10-15 17:45:26 UTC
With the release of Plasma 5.20 things got slightly worse I'm afraid:

1. Plugging in HDMI monitor and telling Plasma to extend the display - works
2. Disabling the monitor and then unplugging it - works
3. Plugging the monitor in again and then extending the display - total crash, around 20 crash report windows open up.

Operating System: Arch Linux
KDE Plasma Version: 5.20.0
KDE Frameworks Version 5.75.0
Qt Version: 5.15.1
Comment 6 Nate Graham 2020-10-24 16:42:46 UTC
Yikes, that's not ideal. Crashing to the login screen when you unplug a screen is no good.
Comment 7 David Edmundson 2020-10-24 18:31:21 UTC
>3. Plugging the monitor in again and then extending the display - total crash, around 20 crash report windows open up.

That's not the same as this then.
It means the client crashed, not KWin.
Comment 8 Vlad Zahorodnii 2020-10-26 16:05:03 UTC
(In reply to Lukas from comment #5)
> With the release of Plasma 5.20 things got slightly worse I'm afraid:
> 
> 1. Plugging in HDMI monitor and telling Plasma to extend the display - works
> 2. Disabling the monitor and then unplugging it - works
> 3. Plugging the monitor in again and then extending the display - total
> crash, around 20 crash report windows open up.

this sounds like bug 426293
Comment 9 Nate Graham 2020-10-26 19:33:22 UTC
Bug 426293 was fixed in Plasma 5.20.1. Is anyone experiencing this bug with that version?
Comment 10 Andrius Štikonas 2020-10-28 14:55:10 UTC
(In reply to Nate Graham from comment #9)
> Bug 426293 was fixed in Plasma 5.20.1. Is anyone experiencing this bug with
> that version?

Yes, my 5.20.1 session just crashed when unplugging external screen (with internal screen disabled). It is reproducible.
Comment 11 Nate Graham 2020-10-28 18:39:37 UTC
Darn. :(
Comment 12 Vlad Zahorodnii 2020-10-28 18:53:50 UTC
(In reply to Nate Graham from comment #9)
> Bug 426293 was fixed in Plasma 5.20.1. Is anyone experiencing this bug with
> that version?
It was fixed in 5.20.1, but you also need to recompile kwayland-server against Qt 5.15.2, which will be released the next week.
Comment 13 Andrius Štikonas 2020-10-28 18:56:39 UTC
(In reply to Vlad Zahorodnii from comment #12)
> (In reply to Nate Graham from comment #9)
> > Bug 426293 was fixed in Plasma 5.20.1. Is anyone experiencing this bug with
> > that version?
> It was fixed in 5.20.1, but you also need to recompile kwayland-server
> against Qt 5.15.2, which will be released the next week.

Ok, I'll recompile it once I get Qt 5.15.2. Thanks for clarifying.
Comment 14 David Edmundson 2020-11-24 23:55:22 UTC
>Ok, I'll recompile it once I get Qt 5.15.2. Thanks for clarifying.
Comment 15 Bug Janitor Service 2020-12-09 04:34:10 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 16 Andrius Štikonas 2020-12-09 11:52:54 UTC
(In reply to Bug Janitor Service from comment #15)
Yes, I still remember this and I am waiting for Qt upgrade from my distro (5.15.1 at the moment).
Comment 17 Patrick Silva 2020-12-09 12:16:21 UTC
Qt was updated to 5.15.2 version on neon unstable a few hours ago, but I can't try to reproduce this crash because now multi-monitor is completely broken. I can't even set "Switch to external screen" mode.
Comment 18 Bug Janitor Service 2020-12-24 04:34:41 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 19 postix 2020-12-26 20:29:16 UTC
> It was fixed in 5.20.1, but you also need to recompile kwayland-server
> against Qt 5.15.2, which will be released the next week.

Can still reproduce it on 

Operating System: Manjaro Linux
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.2
Kernel Version: 5.9.11-3-MANJARO
Graphics Processor: Mesa Intel® HD Graphics 620
Comment 20 Andrius Štikonas 2020-12-26 20:33:06 UTC
(In reply to postix from comment #19)
> > It was fixed in 5.20.1, but you also need to recompile kwayland-server
> > against Qt 5.15.2, which will be released the next week.
> 
> Can still reproduce it on 
> 
> Operating System: Manjaro Linux
> KDE Plasma Version: 5.20.4
> KDE Frameworks Version: 5.76.0
> Qt Version: 5.15.2
> Kernel Version: 5.9.11-3-MANJARO
> Graphics Processor: Mesa Intel® HD Graphics 620

Can you check if kwayland-server was compiled against QT 5.15.2? Otherwise this doesn't say much.
Comment 21 postix 2020-12-26 20:34:14 UTC
> Can you check if kwayland-server was compiled against QT 5.15.2? Otherwise this doesn't say much.

Sure, how can I check it?
Comment 22 Andrius Štikonas 2020-12-26 20:46:54 UTC
(In reply to postix from comment #21)
> > Can you check if kwayland-server was compiled against QT 5.15.2? Otherwise this doesn't say much.
> 
> Sure, how can I check it?

If manjaro has some kind of online package database, you can check whether kwayland-server package was built more recently than Qt or not.

Maybe you can also try to check file dates on your file system. ALthough, I'm not sure if those will show build time or install time.
Comment 23 postix 2020-12-26 22:06:32 UTC
pacman -Q --info qt5-base
Version                  : 5.15.2-1
Created at               : So 22 Nov 2020 12:16:09 CET

pacman -Q --info kwayland-server
Version                  : 5.20.4-1
Created at:Di 01 Dez 2020 15:33:04 CET
Comment 24 Andrius Štikonas 2020-12-28 19:27:44 UTC
(In reply to Vlad Zahorodnii from comment #12)
> (In reply to Nate Graham from comment #9)
> > Bug 426293 was fixed in Plasma 5.20.1. Is anyone experiencing this bug with
> > that version?
> It was fixed in 5.20.1, but you also need to recompile kwayland-server
> against Qt 5.15.2, which will be released the next week.

I upgraded to Qt 5.15.2 and I too can still reproduce this bug.

I recompiled kwayland-server (even though I don't see why that would be necessary, kwayland-server doesn't use any of the Qt private APIs)
Comment 25 Ritesh Raj Sarraf 2021-03-26 16:49:04 UTC
I'm hit by this issue. And this is on the latest as of today, which is:

Operating System: Debian GNU/Linux
KDE Plasma Version: 5.21.3
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2
Kernel Version: 5.10.0-5-amd64
OS Type: 64-bit
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Comment 26 Ritesh Raj Sarraf 2021-03-26 16:52:09 UTC
(In reply to Ritesh Raj Sarraf from comment #25)
> I'm hit by this issue. And this is on the latest as of today, which is:
> 
> Operating System: Debian GNU/Linux
> KDE Plasma Version: 5.21.3
> KDE Frameworks Version: 5.80.0
> Qt Version: 5.15.2
> Kernel Version: 5.10.0-5-amd64
> OS Type: 64-bit
> Graphics Platform: X11
> Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
> Memory: 15.4 GiB of RAM
> Graphics Processor: Mesa Intel® UHD Graphics 620

Just to mention, the reporting is done from X11 because without multi-monitor setup, kwin_wayland is not ready for me for daily use. The crash was persistently seen when running under Wayland with a multi-monitor setup.
Comment 27 David Edmundson 2021-03-26 17:00:11 UTC
When you say you reproduced it, do you mean reproduced and checked the backtraces were similar or simply had a crash?
Comment 28 Andrius Štikonas 2021-03-26 18:15:47 UTC
(In reply to David Edmundson from comment #27)
> When you say you reproduced it, do you mean reproduced and checked the
> backtraces were similar or simply had a crash?

Admittedly I did not obtain backtraces and simply had a crash. I probably have to install ssh server for that?
Comment 29 Nate Graham 2021-03-30 15:15:09 UTC
Bug 426293 was re-opened; could this just be the same thing?
Comment 30 Ritesh Raj Sarraf 2021-05-24 09:01:47 UTC
I have just tested with the latest kwin. While the issue has significantly improved, it is not fixed completely.

The applications do not crash any more. But most KDE applications (dolphin, konsole) which were already running while the HDMI display cable was unplugged, go into a frozen state consuming 100% CPU cycles. Those applications do not recover at all.

I'd really love to see this issue fixed before the final 5.22 release. So please, help me help you with whatever information you may need.

Operating System: Debian GNU/Linux 11
KDE Plasma Version: 5.21.90
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Kernel Version: 5.10.0-7-amd64 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Comment 31 David Edmundson 2021-05-24 09:27:32 UTC
Lets keep that on 426293, rather than have two