Bug 488375 - Any changes to external monitor state (e.g. switch to external monitor) cause kwin to crash in KWin::Wayland::WaylandEventThread::dispatch()
Summary: Any changes to external monitor state (e.g. switch to external monitor) cause...
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: generic-crash (show other bugs)
Version: 6.0.5
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen, regression, wayland-only
Depends on:
Blocks:
 
Reported: 2024-06-11 17:54 UTC by fake.name
Modified: 2024-07-26 03:46 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
the system log around the time of the most recent crash. All crashes are like this. please forgiv me for redacting username and plasma theme names. (19.40 KB, text/plain)
2024-06-11 17:54 UTC, fake.name
Details
coredumpctl gdb [PID] (22.77 KB, text/plain)
2024-06-13 14:59 UTC, fake.name
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fake.name 2024-06-11 17:54:05 UTC
Created attachment 170382 [details]
the system log around the time of the most recent crash. All crashes are like this. please forgiv me for redacting username and plasma theme names.

SUMMARY
Kwin will crash, killing all non-KDE applications, whenever:
A: an external monitor is plugged in;
B: an external monitor is unplugged;
C: while using an external monitor. the screen shuts off due to inactivity (without sleep or hibernation);
D: Sleep or hibernation occur with an external monitor plugged in.

The only qualitative changes which do not crash KWin is screen locking; all other interactions crash it immediately, and crash.

Every version of plasma 6 has produced this; no version of plasma 5 displayed this for me.

I have only tested this on Wayland since use of X11 with external monitor is untenable on my hardware. The setting used is to display only on external monitor.

STEPS TO REPRODUCE
1. Plug external monitor in. 
Or:
2. Unplug external monitor if booted while connected.
Or:
3. While connected to external monitor, set screen to dim after inactivity, and then do nothing.
Or:
4. Wake computer from sleep while plugged into an external monitor.

OBSERVED RESULT
All state changes w.r.t external monitors hard-crash kwin.

EXPECTED RESULT
It should be possible, ad infinitum, to detach and reattach an external monitor.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch; Zen 6.9.3
(available in About System)
KDE Plasma Version: 6.05, but this has happened since the upgrade to 6.0.0 and never occurred in any 5 versions.
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
Setup: laptop has no dGPU; all graphics handled by 12th gen intel i5  iGPU running Mesa. Monitor is plugged in via HDMI. Tested across multiple monitors, all of which produce the crash 100% of the time.
Comment 2 fake.name 2024-06-13 14:59:36 UTC
Created attachment 170473 [details]
coredumpctl gdb [PID]

Here it is.
Comment 3 Nate Graham 2024-06-13 15:01:47 UTC
It's missing debug symbols and it's not a proper backtrace. Please follow the instructions at that link.
Comment 4 fake.name 2024-06-13 15:39:58 UTC
(In reply to Nate Graham from comment #3)
> It's missing debug symbols and it's not a proper backtrace. Please follow
> the instructions at that link.

It is the result of following the instructions in section "retrieving a backtrace using coredumpctl".

Here's what else I tried:
if I attempt to attach GDB to the already running kwin_wayland process, the whole computer immediately freezes up and cannot be unfrozen and must be restarted -- no go on that route.

If I instruct GDB to launch a new copy of the process, crash it myself and get a backtrace,  (ie, "gdb kwin_wayland","(gdb) run", cause crash, "(gdb) bakctrace")  the result is below.

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x0000708d6fea8eb3 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
#2  0x0000708d6fe50a30 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x0000708d6fe384c3 in __GI_abort () at abort.c:79
#4  0x0000708d7048c6b7 in qAbort () at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qglobal.cpp:136
#5  qt_message_fatal<QString&> (context=<optimized out>, message=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qlogging.cpp:2052
#6  qt_message(QtMsgType, const QMessageLogContext &, const char *, typedef __va_list_tag __va_list_tag *)
    (msgType=msgType@entry=QtFatalMsg, context=..., msg=msg@entry=0x708d731f4b9e "Wayland connection broke", ap=ap@entry=0x7ffdecbf40f0)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qlogging.cpp:374
#7  0x0000708d7048ce5b in QMessageLogger::fatal (this=this@entry=0x7ffdecbf41d0, msg=msg@entry=0x708d731f4b9e "Wayland connection broke")
    at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qlogging.cpp:889
#8  0x0000708d72d4ba36 in KWin::Wayland::WaylandEventThread::dispatch (this=<optimized out>) at /usr/src/debug/kwin/kwin-6.0.5/src/backends/wayland/wayland_display.cpp:75
#9  0x0000708d72d4ba41 in KWin::Wayland::WaylandEventThread::dispatch (this=<optimized out>) at /usr/src/debug/kwin/kwin-6.0.5/src/backends/wayland/wayland_display.cpp:75
#10 KWin::Wayland::WaylandDisplay::flush (this=<optimized out>) at /usr/src/debug/kwin/kwin-6.0.5/src/backends/wayland/wayland_display.cpp:347
#11 0x0000708d705a17e7 in QtPrivate::QSlotObjectBase::call (this=0x652b439a6ec0, r=0x652b43789170, a=0x7ffdecbf42a8, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469
#12 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4086
#13 0x0000708d706c5b7e in QAbstractEventDispatcher::awake (this=0x652b43874cb0) at /usr/src/debug/qt6-base/build/src/corelib/Core_autogen/include/moc_qabstracteventdispatcher.cpp:158
#14 QEventDispatcherUNIX::processEvents (this=0x652b43874cb0, flags=flags@entry=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_unix.cpp:412
#15 0x0000708d70ff95b3 in QUnixEventDispatcherQPA::processEvents (this=<optimized out>, flags=...) at /usr/src/debug/qt6-base/qtbase/src/gui/platform/unix/qunixeventdispatcher.cpp:27
#16 0x0000708d7054f10e in QEventLoop::processEvents (this=0x7ffdecbf4490, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:100
#17 QEventLoop::exec (this=0x7ffdecbf4490, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:182
#18 0x0000708d7054945d in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qflags.h:74
#19 0x0000708d714f83fa in QApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2555
#20 0x0000652b1494ad3f in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kwin/kwin-6.0.5/src/main_wayland.cpp:609
Comment 5 Nate Graham 2024-06-13 15:47:48 UTC
That's better, thanks. Perhaps our documentation needs some improvement!
Comment 6 David Redondo 2024-06-14 08:37:32 UTC
That's a different crash from a neste KWin I think
Comment 7 Nate Graham 2024-06-26 23:56:20 UTC
Are you able to reproduce this issue in Plasma 6.1, which was released last week?
Comment 8 Bug Janitor Service 2024-07-11 03:47:09 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 9 Bug Janitor Service 2024-07-26 03:46:18 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now 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

Thank you for helping us make KDE software even better for everyone!