Bug 439726 - kwin_wayland crashes when launching Kitty terminal emulator
Summary: kwin_wayland crashes when launching Kitty terminal emulator
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.22.3
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2021-07-10 15:46 UTC by Cil Satriawan
Modified: 2022-02-18 04:37 UTC (History)
3 users (show)

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


Attachments
Backtrace log (15.07 KB, text/plain)
2021-07-11 03:31 UTC, Cil Satriawan
Details
kwin_wayland full backtrace (7.93 KB, text/x-log)
2021-07-11 19:47 UTC, Cil Satriawan
Details
kwin_x11 full backtrace (11.48 KB, text/x-log)
2021-07-11 19:47 UTC, Cil Satriawan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cil Satriawan 2021-07-10 15:46:00 UTC
SUMMARY
Launching Kitty terminal emulator (0.21.2) crashes the Plasma session on Wayland.

STEPS TO REPRODUCE
1. Login to a Plasma Wayland session.
2. Launch Kitty.

OBSERVED RESULT
When launching Kitty from another terminal (Alacritty), the following error message is received:
[glfw error 65544]: Wayland: fatal display error: Broken pipe
The entire Plasma session is restarted immediately afterwards (as if I had just logged in).
Backtrace indicates that the kwin_wayland process segfaulted. Backtrace below.

EXPECTED RESULT
Kitty launches.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux (Kernel 5.12.15)
(available in About System)
KDE Plasma Version: 5.22.3
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
I am using the systemd user startup service for the Plasma session.
The machine this occurs on is using an Intel integrated graphics card.

Backtrace:

          PID: 44596 (kded5)
           UID: 1000 (cilsat)
           GID: 1000 (cilsat)
        Signal: 11 (SEGV)
     Timestamp: Sat 2021-07-10 20:56:42 WIB (1h 42min ago)
  Command Line: /usr/bin/kded5
    Executable: /usr/bin/kded5
 Control Group: /user.slice/user-1000.slice/user@1000.service/session.slice/plasma-kded.service
          Unit: user@1000.service
     User Unit: plasma-kded.service
         Slice: user-1000.slice
     Owner UID: 1000 (cilsat)
       Boot ID: 61bcef0d61e3499b8fbcff0e7c620d54
    Machine ID: 190e7d0ad38f40f09ae95307bb7c4e89
      Hostname: thinkbro
       Storage: /var/lib/systemd/coredump/core.kded5.1000.61bcef0d61e3499b8fbcff0e7c620d54.44596.1625925402000000.zst (present)
     Disk Size: 2.3M
       Message: Process 44596 (kded5) of user 1000 dumped core.

                Stack trace of thread 44596:
                #0  0x00007ff7f5b0dd22 raise (libc.so.6 + 0x3cd22)
                #1  0x00007ff7f6c8f05b _ZN6KCrash19defaultCrashHandlerEi (libKF5Crash.so.5 + 0x505b)
                #2  0x00007ff7f5b0dda0 __restore_rt (libc.so.6 + 0x3cda0)
                #3  0x00007ff7f5f7f84d _ZN7QThread4exitEi (libQt5Core.so.5 + 0xcc84d)
                #4  0x00007ff7cd65f53e _ZN6ColorDD2Ev (kded_colord.so + 0x1553e)
                #5  0x00007ff7cd65f5da _ZN6ColorDD0Ev (kded_colord.so + 0x155da)
                #6  0x0000563580ea7ac5 n/a (kded5 + 0x8ac5)
                #7  0x0000563580ea7c39 n/a (kded5 + 0x8c39)
                #8  0x0000563580ea56a4 n/a (kded5 + 0x66a4)
                #9  0x00007ff7f5af8b25 __libc_start_main (libc.so.6 + 0x27b25)
                #10 0x0000563580ea5abe n/a (kded5 + 0x6abe)

                Stack trace of thread 44624:
                #0  0x00007ff7f5bc4b2f __poll (libc.so.6 + 0xf3b2f)
                #1  0x00007ff7f4ce4b29 n/a (libglib-2.0.so.0 + 0xa7b29)
                #2  0x00007ff7f4c8e871 g_main_context_iteration (libglib-2.0.so.0 + 0x51871)
                #3  0x00007ff7ee0a5ebe n/a (libdconfsettings.so + 0x5ebe)
                #4  0x00007ff7f4cbf2c1 n/a (libglib-2.0.so.0 + 0x822c1)
                #5  0x00007ff7f5721259 start_thread (libpthread.so.0 + 0x9259)
                #6  0x00007ff7f5bcf5e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 44623:
                #0  0x00007ff7f5bc4b2f __poll (libc.so.6 + 0xf3b2f)
                #1  0x00007ff7f4ce4b29 n/a (libglib-2.0.so.0 + 0xa7b29)
                #2  0x00007ff7f4c8e871 g_main_context_iteration (libglib-2.0.so.0 + 0x51871)
                #3  0x00007ff7f4c8e8c2 n/a (libglib-2.0.so.0 + 0x518c2)
                #4  0x00007ff7f4cbf2c1 n/a (libglib-2.0.so.0 + 0x822c1)
                #5  0x00007ff7f5721259 start_thread (libpthread.so.0 + 0x9259)
                #6  0x00007ff7f5bcf5e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 44626:
                #0  0x00007ff7f5bc4b2f __poll (libc.so.6 + 0xf3b2f)
                #1  0x00007ff7f4ce4b29 n/a (libglib-2.0.so.0 + 0xa7b29)
                #2  0x00007ff7f4c90693 g_main_loop_run (libglib-2.0.so.0 + 0x53693)
                #3  0x00007ff7dc13c8c8 n/a (libgio-2.0.so.0 + 0x1018c8)
                #4  0x00007ff7f4cbf2c1 n/a (libglib-2.0.so.0 + 0x822c1)
                #5  0x00007ff7f5721259 start_thread (libpthread.so.0 + 0x9259)
                #6  0x00007ff7f5bcf5e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 44609:
                #0  0x00007ff7f5bc4b2f __poll (libc.so.6 + 0xf3b2f)
                #1  0x00007ff7f4ce4b29 n/a (libglib-2.0.so.0 + 0xa7b29)
                #2  0x00007ff7f4c8e871 g_main_context_iteration (libglib-2.0.so.0 + 0x51871)
                #3  0x00007ff7f61c4fd6 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x311fd6)
                #4  0x00007ff7f616ad1c _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2b7d1c)
                #5  0x00007ff7f5f7fe12 _ZN7QThread4execEv (libQt5Core.so.5 + 0xcce12)
                #6  0x00007ff7f5f80fef n/a (libQt5Core.so.5 + 0xcdfef)
                #7  0x00007ff7f5721259 start_thread (libpthread.so.0 + 0x9259)
                #8  0x00007ff7f5bcf5e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 44604:
                #0  0x00007ff7f5bc4b2f __poll (libc.so.6 + 0xf3b2f)
                #1  0x00007ff7f4ce4b29 n/a (libglib-2.0.so.0 + 0xa7b29)
                #2  0x00007ff7f4c8e871 g_main_context_iteration (libglib-2.0.so.0 + 0x51871)
                #3  0x00007ff7f61c4fd6 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x311fd6)
                #4  0x00007ff7f616ad1c _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2b7d1c)
                #5  0x00007ff7f5f7fe12 _ZN7QThread4execEv (libQt5Core.so.5 + 0xcce12)
                #6  0x00007ff7f64caae8 n/a (libQt5DBus.so.5 + 0x15ae8)
                #7  0x00007ff7f5f80fef n/a (libQt5Core.so.5 + 0xcdfef)
                #8  0x00007ff7f5721259 start_thread (libpthread.so.0 + 0x9259)
                #9  0x00007ff7f5bcf5e3 __clone (libc.so.6 + 0xfe5e3)
Comment 1 Zamundaaa 2021-07-10 22:25:09 UTC
You provided the backtrace for kded5. Please do
coredumpctl debug kwin_wayland
and then input "bt" to get the backtrace of KWin.

It's probably not gonna be too useful without debug symbols though.
Comment 2 Cil Satriawan 2021-07-11 03:31:54 UTC
Created attachment 139986 [details]
Backtrace log
Comment 3 Cil Satriawan 2021-07-11 03:33:36 UTC
I've attached the output of the following command:
> echo bt | coredumpctl gdb
This is using KWin from the Plasma/5.22 branch with debugging symbols enabled.
Comment 4 Zamundaaa 2021-07-11 10:11:22 UTC
Do you have any window rules set that would affect Kitty? Specifically, that would affect on which virtual desktops it should be on?
Comment 5 Cil Satriawan 2021-07-11 11:23:12 UTC
Yes, it appears a rule was set that forced Kitty to launch in virtual desktop 1. After deleting the rule, the segfault disappears. Unfortunately, enabling the rule again does not reproduce the segfault.
Prior to this, I also confirmed that the segfault also occurred in x11.
Is there anything else I could help with?
Comment 6 Zamundaaa 2021-07-11 12:50:42 UTC
Unreproducable bugs are the worst, maybe we can still figure out what it was though. More information could be retrieved from the coredump with "bt full" instead of just "bt", and the backtrace of kwin_x11 might be useful, too.
Comment 7 Cil Satriawan 2021-07-11 19:47:18 UTC
Created attachment 139997 [details]
kwin_wayland full backtrace

I've attached the full GDB backtraces from the kwin_x11 and kwin_wayland coredumps. Reproducing the bug has been unfruitful so far, so hopefully there's something useful in these logs that I don't see.
Comment 8 Cil Satriawan 2021-07-11 19:47:53 UTC
Created attachment 139998 [details]
kwin_x11 full backtrace
Comment 9 Vlad Zahorodnii 2021-07-12 11:42:57 UTC
One thing that's in common is that kwin crashes in virtual desktop code. Not sure why.
Comment 10 Zamundaaa 2021-07-12 12:25:06 UTC
Hmm, at least in the x11 backtrace "VirtualDesktopManager::self()->desktopForX11Id(desktop);" in AbstractClient::setDesktop(int) returned nullptr.
So there either were 0 virtual desktops somehow or rule()->checkDesktop returned a number smaller than -1.

In the wayland backtrace probably something similar happened. At least that's the only way I could explain it.
Comment 11 Vlad Zahorodnii 2022-01-19 18:55:43 UTC
@Cil can you attach your .config/kwinrc and .config/kwinrulesrc file to the bug report?
Comment 12 Bug Janitor Service 2022-02-03 04:38:02 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 13 Bug Janitor Service 2022-02-18 04:37:11 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!