Bug 520145 - kwin_wayland crashes in KWin::LibInput::Connection::applyScreenToDevice when toggling monitor power or VRR via OSD
Summary: kwin_wayland crashes in KWin::LibInput::Connection::applyScreenToDevice when ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: libinput (other bugs)
Version First Reported In: 6.6.5
Platform: CachyOS Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 520700 (view as bug list)
Depends on:
Blocks:
 
Reported: 2026-05-14 13:13 UTC by y3206771300
Modified: 2026-05-28 13:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.6.6
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description y3206771300 2026-05-14 13:13:09 UTC
DESCRIPTION
kwin_wayland crashes (SIGSEGV) whenever the monitor's connection state or configuration changes rapidly (e.g., toggling VRR via monitor OSD or power-cycling the display).

STEPS TO REPRODUCE
1. Log into a Plasma Wayland session.
2. Open several applications.
3. Perform a hardware-level display change:
    Either toggle the VRR (Adaptive Sync) setting in the monitor's OSD menu.
    Or turn the monitor power OFF and then ON again.
4. The entire session crashes, all applications are closed

OBSERVED RESULT
KWin crashes with signal SIGSEGV, Segmentation fault and restarted. All the apps attached to this session is lost.

EXPECTED RESULT
KWin shouldn't crash. User apps should leave unchanged after toggling the monitor/IO devices

SOFTWARE/OS VERSIONS
Operating System : CachyOS Linux
KDE Plasma Version: 6.6.5
KDE Frameworks Version: 6.26.0
Qt Version: 6.11.0
Kernel Version: 7.0.5-2-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 20 × Intel® Core™ i5-14600KF
Memory: 32 GiB of RAM (31.1 GiB usable)
Graphics Processor: AMD Radeon RX 9070 XT

ADDITIONAL INFORMATION
I found this was probably caused by a SIGSEGV segmentation fault and I used coredumpctl to debug. It appears that when a display is temporarily disconnected or its EDID is re-read.
-- backtrace:
           PID: 113274 (kwin_wayland)
           UID: 1000 (makoto)
           GID: 1000 (makoto)
        Signal: 11 (SEGV)
     Timestamp: Thu 2026-05-14 20:18:02 CST (44min ago)
  Command Line: /usr/bin/kwin_wayland --wayland-fd 7 --socket wayland-0 --xwayland-fd 8 --xwayland-fd 9 --xwayland-display :0 --xwayland-xauthority /run/user/1000/xauth_MolrOe --xwayland
    Executable: /usr/bin/kwin_wayland
 Control Group: /user.slice/user-1000.slice/user@1000.service/session.slice/plasma-kwin_wayland.service
          Unit: user@1000.service
     User Unit: plasma-kwin_wayland.service
         Slice: user-1000.slice
     Owner UID: 1000 (makoto)
       Boot ID: 82cd387cb2be42d983bd56bdbb0e2887
    Machine ID: 0be00530383242298f2a5f33ce3184f5
      Hostname: cachyos
       Storage: /var/lib/systemd/coredump/core.kwin_wayland.1000.82cd387cb2be42d983bd56bdbb0e2887.113274.1778761082000000.zst (present)
  Size on Disk: 4.2M
       Message: Process 113274 (kwin_wayland) of user 1000 dumped core.

                Stack trace of thread 113274:
                #0  0x00007f54e359b220 _ZN4KWin8LibInput10Connection19applyScreenToDeviceEPNS0_6DeviceE (libkwin.so.6 + 0x59b220)
                #1  0x00007f54e359c962 _ZN4KWin8LibInput10Connection13processEventsEv (libkwin.so.6 + 0x59c962)
                #2  0x00007f54e06039f1 _ZN7QObject5eventEP6QEvent (libQt6Core.so.6 + 0x2039f1)
                #3  0x00007f54e1704cab _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt6Widgets.so.6 + 0x104cab)
                #4  0x00007f54e0596448 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt6Core.so.6 + 0x196448)
                #5  0x00007f54e05989c8 _ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData (libQt6Core.so.6 + 0x1989c8)
                #6  0x00007f54e07b1a5b _ZN20QEventDispatcherUNIX13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt6Core.so.6 + 0x3b1a5b)
                #7  0x00007f54e13fe362 _ZN23QUnixEventDispatcherQPA13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt6Gui.so.6 + 0x7fe362)
                #8  0x00007f54e05a5444 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt6Core.so.6 + 0x1a5444)
                #9  0x00007f54e059acd4 _ZN16QCoreApplication4execEv (libQt6Core.so.6 + 0x19acd4)
                #10 0x00005629ac238692 n/a (/usr/bin/kwin_wayland + 0x3f692)
                #11 0x00007f54dfc27c8e n/a (libc.so.6 + 0x27c8e)
                #12 0x00007f54dfc27dcb __libc_start_main (libc.so.6 + 0x27dcb)
                #13 0x00005629ac23f205 n/a (/usr/bin/kwin_wayland + 0x46205)

                Stack trace of thread 113280:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca80e8 n/a (libc.so.6 + 0xa80e8)
                #2  0x00007f54dfca84b3 n/a (libc.so.6 + 0xa84b3)
                #3  0x00007f54dfcab090 pthread_cond_wait (libc.so.6 + 0xab090)
                #4  0x00007f54cd046d6e n/a (libgallium-26.1.0-arch2.1.so + 0x646d6e)
                #5  0x00007f54ccffa12d n/a (libgallium-26.1.0-arch2.1.so + 0x5fa12d)
                #6  0x00007f54cd046cac n/a (libgallium-26.1.0-arch2.1.so + 0x646cac)
                #7  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #8  0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113279:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca8178 n/a (libc.so.6 + 0xa8178)
                #2  0x00007f54dfd3ba13 ppoll (libc.so.6 + 0x13ba13)
                #3  0x00007f54dede55b7 n/a (libglib-2.0.so.0 + 0x6d5b7)
                #4  0x00007f54dede56b2 g_main_context_iteration (libglib-2.0.so.0 + 0x6d6b2)
                #5  0x00007f54e08f498b _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt6Core.so.6 + 0x4f498b)
                #6  0x00007f54e05a5444 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt6Core.so.6 + 0x1a5444)
                #7  0x00007f54e06ea35e _ZN7QThread4execEv (libQt6Core.so.6 + 0x2ea35e)
                #8  0x00007f54e0b6b249 n/a (libQt6DBus.so.6 + 0x3a249)
                #9  0x00007f54e07b3b8a n/a (libQt6Core.so.6 + 0x3b3b8a)
                #10 0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #11 0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113287:
                #0  0x00007f54e0705420 _ZN10QArrayData10deallocateEPS_xx (libQt6Core.so.6 + 0x305420)
                #1  0x00007f54e0bccdd2 n/a (libQt6DBus.so.6 + 0x9bdd2)
                #2  0x00007f54e0b5149d n/a (libQt6DBus.so.6 + 0x2049d)
                #3  0x00007f54e0b56f73 n/a (libQt6DBus.so.6 + 0x25f73)
                #4  0x00007f54e060cea5 n/a (libQt6Core.so.6 + 0x20cea5)
                #5  0x00007f54e35980df n/a (libkwin.so.6 + 0x5980df)
                #6  0x00007f54e06039f1 _ZN7QObject5eventEP6QEvent (libQt6Core.so.6 + 0x2039f1)
                #7  0x00007f54e1704cab _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt6Widgets.so.6 + 0x104cab)
                #8  0x00007f54e0596448 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt6Core.so.6 + 0x196448)
                #9  0x00007f54e05989c8 _ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData (libQt6Core.so.6 + 0x1989c8)
                #10 0x00007f54e08f7e20 n/a (libQt6Core.so.6 + 0x4f7e20)
                #11 0x00007f54dede402d n/a (libglib-2.0.so.0 + 0x6c02d)
                #12 0x00007f54dede5558 n/a (libglib-2.0.so.0 + 0x6d558)
                #13 0x00007f54dede56b2 g_main_context_iteration (libglib-2.0.so.0 + 0x6d6b2)
                #14 0x00007f54e08f498b _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt6Core.so.6 + 0x4f498b)
                #15 0x00007f54e05a5444 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt6Core.so.6 + 0x1a5444)
                #16 0x00007f54e06ea35e _ZN7QThread4execEv (libQt6Core.so.6 + 0x2ea35e)
                #17 0x00007f54e07b3c1d n/a (libQt6Core.so.6 + 0x3b3c1d)
                #18 0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #19 0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113281:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca80e8 n/a (libc.so.6 + 0xa80e8)
                #2  0x00007f54dfca84b3 n/a (libc.so.6 + 0xa84b3)
                #3  0x00007f54dfcab090 pthread_cond_wait (libc.so.6 + 0xab090)
                #4  0x00007f54cd046d6e n/a (libgallium-26.1.0-arch2.1.so + 0x646d6e)
                #5  0x00007f54ccffa12d n/a (libgallium-26.1.0-arch2.1.so + 0x5fa12d)
                #6  0x00007f54cd046cac n/a (libgallium-26.1.0-arch2.1.so + 0x646cac)
                #7  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #8  0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113283:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca80e8 n/a (libc.so.6 + 0xa80e8)
                #2  0x00007f54dfca84b3 n/a (libc.so.6 + 0xa84b3)
                #3  0x00007f54dfcab090 pthread_cond_wait (libc.so.6 + 0xab090)
                #4  0x00007f54cd046d6e n/a (libgallium-26.1.0-arch2.1.so + 0x646d6e)
                #5  0x00007f54ccffa12d n/a (libgallium-26.1.0-arch2.1.so + 0x5fa12d)
                #6  0x00007f54cd046cac n/a (libgallium-26.1.0-arch2.1.so + 0x646cac)
                #7  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #8  0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113318:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca80e8 n/a (libc.so.6 + 0xa80e8)
                #2  0x00007f54dfca84b3 n/a (libc.so.6 + 0xa84b3)
                #3  0x00007f54dfcab090 pthread_cond_wait (libc.so.6 + 0xab090)
                #4  0x00007f54cd046d6e n/a (libgallium-26.1.0-arch2.1.so + 0x646d6e)
                #5  0x00007f54ccffa12d n/a (libgallium-26.1.0-arch2.1.so + 0x5fa12d)
                #6  0x00007f54cd046cac n/a (libgallium-26.1.0-arch2.1.so + 0x646cac)
                #7  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #8  0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113320:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca80e8 n/a (libc.so.6 + 0xa80e8)
                #2  0x00007f54dfca84b3 n/a (libc.so.6 + 0xa84b3)
                #3  0x00007f54dfcab34a pthread_cond_timedwait (libc.so.6 + 0xab34a)
                #4  0x00007f54e07abb33 _ZN14QWaitCondition4waitEP6QMutex14QDeadlineTimer (libQt6Core.so.6 + 0x3abb33)
                #5  0x00007f54e06e6906 n/a (libQt6Core.so.6 + 0x2e6906)
                #6  0x00007f54e07b3b8a n/a (libQt6Core.so.6 + 0x3b3b8a)
                #7  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #8  0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113284:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca80e8 n/a (libc.so.6 + 0xa80e8)
                #2  0x00007f54dfca84b3 n/a (libc.so.6 + 0xa84b3)
                #3  0x00007f54dfcab090 pthread_cond_wait (libc.so.6 + 0xab090)
                #4  0x00007f54cd046d6e n/a (libgallium-26.1.0-arch2.1.so + 0x646d6e)
                #5  0x00007f54ccffa12d n/a (libgallium-26.1.0-arch2.1.so + 0x5fa12d)
                #6  0x00007f54cd046cac n/a (libgallium-26.1.0-arch2.1.so + 0x646cac)
                #7  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #8  0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113286:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca80e8 n/a (libc.so.6 + 0xa80e8)
                #2  0x00007f54dfca84b3 n/a (libc.so.6 + 0xa84b3)
                #3  0x00007f54dfcab090 pthread_cond_wait (libc.so.6 + 0xab090)
                #4  0x00007f54cd046d6e n/a (libgallium-26.1.0-arch2.1.so + 0x646d6e)
                #5  0x00007f54ccffa12d n/a (libgallium-26.1.0-arch2.1.so + 0x5fa12d)
                #6  0x00007f54cd046cac n/a (libgallium-26.1.0-arch2.1.so + 0x646cac)
                #7  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #8  0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113317:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca80e8 n/a (libc.so.6 + 0xa80e8)
                #2  0x00007f54dfca84b3 n/a (libc.so.6 + 0xa84b3)
                #3  0x00007f54dfcab090 pthread_cond_wait (libc.so.6 + 0xab090)
                #4  0x00007f54cd046d6e n/a (libgallium-26.1.0-arch2.1.so + 0x646d6e)
                #5  0x00007f54ccffa12d n/a (libgallium-26.1.0-arch2.1.so + 0x5fa12d)
                #6  0x00007f54cd046cac n/a (libgallium-26.1.0-arch2.1.so + 0x646cac)
                #7  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #8  0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113321:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca8178 n/a (libc.so.6 + 0xa8178)
                #2  0x00007f54dfd3ba13 ppoll (libc.so.6 + 0x13ba13)
                #3  0x00007f54dede55b7 n/a (libglib-2.0.so.0 + 0x6d5b7)
                #4  0x00007f54dede56b2 g_main_context_iteration (libglib-2.0.so.0 + 0x6d6b2)
                #5  0x00007f54e08f498b _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt6Core.so.6 + 0x4f498b)
                #6  0x00007f54e05a5444 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt6Core.so.6 + 0x1a5444)
                #7  0x00007f54e06ea35e _ZN7QThread4execEv (libQt6Core.so.6 + 0x2ea35e)
                #8  0x00007f54e07b3c1d n/a (libQt6Core.so.6 + 0x3b3c1d)
                #9  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #10 0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113319:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca80e8 n/a (libc.so.6 + 0xa80e8)
                #2  0x00007f54dfca84b3 n/a (libc.so.6 + 0xa84b3)
                #3  0x00007f54dfcab090 pthread_cond_wait (libc.so.6 + 0xab090)
                #4  0x00007f54cd046d6e n/a (libgallium-26.1.0-arch2.1.so + 0x646d6e)
                #5  0x00007f54ccffa12d n/a (libgallium-26.1.0-arch2.1.so + 0x5fa12d)
                #6  0x00007f54cd046cac n/a (libgallium-26.1.0-arch2.1.so + 0x646cac)
                #7  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #8  0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113285:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca80e8 n/a (libc.so.6 + 0xa80e8)
                #2  0x00007f54dfca84b3 n/a (libc.so.6 + 0xa84b3)
                #3  0x00007f54dfcab090 pthread_cond_wait (libc.so.6 + 0xab090)
                #4  0x00007f54cd046d6e n/a (libgallium-26.1.0-arch2.1.so + 0x646d6e)
                #5  0x00007f54ccffa12d n/a (libgallium-26.1.0-arch2.1.so + 0x5fa12d)
                #6  0x00007f54cd046cac n/a (libgallium-26.1.0-arch2.1.so + 0x646cac)
                #7  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #8  0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113282:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca80e8 n/a (libc.so.6 + 0xa80e8)
                #2  0x00007f54dfca84b3 n/a (libc.so.6 + 0xa84b3)
                #3  0x00007f54dfcab090 pthread_cond_wait (libc.so.6 + 0xab090)
                #4  0x00007f54cd046d6e n/a (libgallium-26.1.0-arch2.1.so + 0x646d6e)
                #5  0x00007f54ccffa12d n/a (libgallium-26.1.0-arch2.1.so + 0x5fa12d)
                #6  0x00007f54cd046cac n/a (libgallium-26.1.0-arch2.1.so + 0x646cac)
                #7  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #8  0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)

                Stack trace of thread 113316:
                #0  0x00007f54dfcb4e22 n/a (libc.so.6 + 0xb4e22)
                #1  0x00007f54dfca80e8 n/a (libc.so.6 + 0xa80e8)
                #2  0x00007f54dfca84b3 n/a (libc.so.6 + 0xa84b3)
                #3  0x00007f54dfcab090 pthread_cond_wait (libc.so.6 + 0xab090)
                #4  0x00007f54cd046d6e n/a (libgallium-26.1.0-arch2.1.so + 0x646d6e)
                #5  0x00007f54ccffa12d n/a (libgallium-26.1.0-arch2.1.so + 0x5fa12d)
                #6  0x00007f54cd046cac n/a (libgallium-26.1.0-arch2.1.so + 0x646cac)
                #7  0x00007f54dfcabd58 n/a (libc.so.6 + 0xabd58)
                #8  0x00007f54dfd4a5dc n/a (libc.so.6 + 0x14a5dc)
                ELF object binary architecture: AMD x86-64

GNU gdb (GDB) 17.2
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/kwin_wayland...
(No debugging symbols found in /usr/bin/kwin_wayland)

⚠️ warning: Can't open file /memfd:JSVMStack:QtQml (deleted) during file-backed mapping note processing

⚠️ warning: Can't open file /memfd:JSGCHeap:QtQml (deleted) during file-backed mapping note processing
[New LWP 113274]
[New LWP 113280]
[New LWP 113279]
[New LWP 113287]
[New LWP 113281]
[New LWP 113283]
[New LWP 113318]
[New LWP 113320]
[New LWP 113284]
[New LWP 113286]
[New LWP 113317]
[New LWP 113321]
[New LWP 113319]
[New LWP 113285]
[New LWP 113282]
--Type <RET> for more, q to quit, c to continue without paging--c
[New LWP 113316]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `/usr/bin/kwin_wayland --wayland-fd 7 --socket wayland-0 --xwayland-fd 8 --xwayland-fd 9 --xwayland-display :0 --xwayland-xauthority /run/user/1000/xauth_MolrOe --xwayland'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f54e359b220 in KWin::LibInput::Connection::applyScreenToDevice(KWin::LibInput::Device*) ()
   from /usr/lib/libkwin.so.6
[Current thread is 1 (Thread 0x7f54d89fbc80 (LWP 113274))]
Comment 1 y3206771300 2026-05-20 04:41:39 UTC
Addtional information:
I'm using a single external monitor connected by displayport. And I also tried HDMI, the bug still reproduced. Plus, this behavior never happened before 6.6.5
Then I looked into the source code and found a likely reason:

        if (!deviceOutput) {
            // still not found
            if (internalOutput) {
                // we have an internal id, so let's use that
                deviceOutput = internalOutput;
            } else {
                // just take first screen, we have no clue
                deviceOutput = outputs.front();
            }
        }
    }

    device->setOutput(deviceOutput);

Guess from the snippet from void Connection::applyScreenToDevice(Device *device): When the only monitor is temporarily disconnected (due to monitor poweroff), the outputs list fetched from the backend becomes completely empty. Since internalOutput is null on a desktop, the code is forced into the else branch, executing deviceOutput = outputs.front();. On an empty QList, this triggers undefined behavior. Even if it doesn't crash immediately on front(), deviceOutput will be assigned an invalid value or nullptr. Passing this unvalidated pointer straight into device->setOutput(deviceOutput); right after will inevitably cause a null pointer dereference / Segmentation Fault inside the input device initialization.
Maybe a boundary check may work?
Comment 2 Bug Janitor Service 2026-05-20 10:47:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/9245
Comment 3 Fuzzbar 2026-05-27 10:59:24 UTC
*** Bug 520700 has been marked as a duplicate of this bug. ***
Comment 4 Vlad Zahorodnii 2026-05-28 07:54:20 UTC
Git commit 10c1fc88571edaba71bd1e1dce53169bceb695c7 by Vlad Zahorodnii, on behalf of David Edmundson.
Committed on 28/05/2026 at 07:29.
Pushed by vladz into branch 'master'.

libinput: Add guard around empty outputs when assigning devices

Although kwin always persists a LogicalOutput this is not true for
backend outputs.

M  +4    -2    src/backends/libinput/connection.cpp

https://invent.kde.org/plasma/kwin/-/commit/10c1fc88571edaba71bd1e1dce53169bceb695c7
Comment 5 Vlad Zahorodnii 2026-05-28 10:39:10 UTC
Git commit 5b88d50f1fa5fb6ab8101931870e3006c9eb2cf8 by Vlad Zahorodnii.
Committed on 28/05/2026 at 08:03.
Pushed by vladz into branch 'Plasma/6.7'.

libinput: Add guard around empty outputs when assigning devices

Although kwin always persists a LogicalOutput this is not true for
backend outputs.


(cherry picked from commit 10c1fc88571edaba71bd1e1dce53169bceb695c7)

Co-authored-by: David Edmundson <kde@davidedmundson.co.uk>

M  +4    -2    src/backends/libinput/connection.cpp

https://invent.kde.org/plasma/kwin/-/commit/5b88d50f1fa5fb6ab8101931870e3006c9eb2cf8
Comment 6 Vlad Zahorodnii 2026-05-28 12:30:08 UTC
Git commit 3293a6052b5c25b0e4105be4ec21f45cbbfa7dec by Vlad Zahorodnii.
Committed on 28/05/2026 at 08:09.
Pushed by vladz into branch 'Plasma/6.6'.

libinput: Add guard around empty outputs when assigning devices

Although kwin always persists a LogicalOutput this is not true for
backend outputs.


(cherry picked from commit 10c1fc88571edaba71bd1e1dce53169bceb695c7)

Co-authored-by: David Edmundson <kde@davidedmundson.co.uk>

M  +4    -2    src/backends/libinput/connection.cpp

https://invent.kde.org/plasma/kwin/-/commit/3293a6052b5c25b0e4105be4ec21f45cbbfa7dec