Bug 487701 - kwin_wayland crash when screen goes blank for a while with Plasma 6.0.90
Summary: kwin_wayland crash when screen goes blank for a while with Plasma 6.0.90
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: git-stable-Plasma/6.1
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: ollilein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-28 17:21 UTC by ollilein
Modified: 2024-06-12 09:03 UTC (History)
6 users (show)

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


Attachments
Backtrace of plasmashell crashing (133 bytes, text/x-log)
2024-05-29 21:55 UTC, ollilein
Details
Backtrace from crashing kwin_wayland (4.02 KB, text/x-log)
2024-05-29 22:32 UTC, ollilein
Details
Backtrace from kwin-6.0.90.1-r1 (4.12 KB, text/x-log)
2024-06-02 16:03 UTC, ollilein
Details
kwin_wayland-6.0.90.1-r1-new (4.12 KB, text/x-log)
2024-06-03 08:42 UTC, ollilein
Details
kwin backtrace (9.43 KB, text/plain)
2024-06-08 07:28 UTC, kostadinshishmanov
Details
Patch for kwin-6.0.90.1 (2.46 KB, patch)
2024-06-10 13:53 UTC, ollilein
Details
Patch for kde-plasma/kwin-6.0.90.1-r2 (1.65 KB, patch)
2024-06-10 13:55 UTC, ollilein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ollilein 2024-05-28 17:21:25 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY

Sometimes when the screen goes blank plasmashell seems to crash, i have firefox, thunderbird and konsole open, it looks like firefox and thunderbird are closed during this crash only konsole is alive on an empty desktop. My second screen is switched off.

When i use the command "kstart plasmashell" the shell comes back and my second screen is reactivated, too.

STEPS TO REPRODUCE
1. Wait for screen to go blank (Not everytime)
2. Move the mouse to reactivate the screen

OBSERVED RESULT

Plasmashell, firefox and thunderbird are closed, konsole remains active.

EXPECTED RESULT

The screen turns on and all my Programs are active

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo 2.14
(available in About System)
KDE Plasma Version: 6.0.90
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
This bug shows first after the update to Plasma 6.0.90.

journalctl --user -r after restarting plasmashell:
[code]Mai 28 19:12:15 Cracked xdg-desktop-por[5493]: No skeleton to export
Mai 28 19:12:15 Cracked xdg-desktop-por[5493]: Failed to create file chooser proxy: Fehler beim Aufruf von StartServiceByName für org.freedesktop.impl.portal.desktop.kde: Zeitüberschreitung wurde erreicht
Mai 28 19:11:50 Cracked xdg-desktop-por[5493]: No skeleton to export
Mai 28 19:11:50 Cracked xdg-desktop-por[5493]: Failed to create settings proxy: Fehler beim Aufruf von StartServiceByName für org.freedesktop.impl.portal.desktop.kde: Zeitüberschreitung wurde erreicht
Mai 28 19:11:28 Cracked drkonqi-coredump-launcher[5801]: Nothing handled the dump :O
Mai 28 19:11:28 Cracked drkonqi-coredump-launcher[5801]: Unable to find file for pid 2109 expected at "kcrash-metadata/firefox.4ed09713e8ef4929a948569943931ce3.2109.ini"
Mai 28 19:11:28 Cracked systemd[1105]: Started Launch DrKonqi for a systemd-coredump crash (PID 5466/UID 0).
Mai 28 19:11:27 Cracked systemd-coredump[5465]: [🡕] Process 2109 (firefox) of user 1000 dumped core.
Mai 28 19:11:27 Cracked systemd-coredump[5465]: elfutils disabled, parsing ELF objects not supported
Mai 28 19:11:26 Cracked drkonqi-coredump-launcher[5544]: Nothing handled the dump :O
Mai 28 19:11:26 Cracked drkonqi-coredump-launcher[5546]: Nothing handled the dump :O
Mai 28 19:11:26 Cracked drkonqi-coredump-launcher[5544]: Unable to find file for pid 5487 expected at "kcrash-metadata/drkonqi.4ed09713e8ef4929a948569943931ce3.5487.ini"
Mai 28 19:11:26 Cracked drkonqi-coredump-launcher[5546]: Unable to find file for pid 5517 expected at "kcrash-metadata/xdg-desktop-portal-kde.4ed09713e8ef4929a948569943931ce3.5517.ini"
Mai 28 19:11:26 Cracked systemd[1105]: Started Launch DrKonqi for a systemd-coredump crash (PID 5524/UID 0).
Mai 28 19:11:26 Cracked systemd[1105]: Started Launch DrKonqi for a systemd-coredump crash (PID 5496/UID 0).
Mai 28 19:11:25 Cracked systemd[1105]: Failed to start Xdg Desktop Portal For KDE.
Mai 28 19:11:25 Cracked systemd[1105]: plasma-xdg-desktop-portal-kde.service: Failed with result 'core-dump'.
Mai 28 19:11:25 Cracked systemd[1105]: plasma-xdg-desktop-portal-kde.service: Main process exited, code=dumped, status=6/ABRT
Mai 28 19:11:25 Cracked systemd-coredump[5523]: [🡕] Process 5517 (xdg-desktop-por) of user 1000 dumped core.
Mai 28 19:11:25 Cracked systemd-coredump[5523]: elfutils disabled, parsing ELF objects not supported
Mai 28 19:11:25 Cracked systemd-coredump[5494]: [🡕] Process 5487 (drkonqi) of user 1000 dumped core.
Mai 28 19:11:25 Cracked systemd-coredump[5494]: elfutils disabled, parsing ELF objects not supported
Mai 28 19:11:25 Cracked xdg-desktop-portal-kde[5517]: Available platform plugins are: vkkhrdisplay, vnc, linuxfb, xcb, offscreen, minimal, wayland-egl, wayland.
Mai 28 19:11:25 Cracked xdg-desktop-portal-kde[5517]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Mai 28 19:11:25 Cracked xdg-desktop-portal-kde[5517]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Mai 28 19:11:25 Cracked xdg-desktop-portal-kde[5517]: qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
Mai 28 19:11:25 Cracked xdg-desktop-portal-kde[5517]: qt.qpa.xcb: could not connect to display
Mai 28 19:11:25 Cracked systemd[1105]: Starting Xdg Desktop Portal For KDE...
Mai 28 19:11:25 Cracked systemd[1105]: xdg-document-portal.service: Failed with result 'exit-code'.
Mai 28 19:11:25 Cracked systemd[1105]: xdg-document-portal.service: Main process exited, code=exited, status=6/NOTCONFIGURED
Mai 28 19:11:25 Cracked xdg-document-portal[5500]: error: fuse init failed: Can't mount path /run/user/1000/doc
Mai 28 19:11:25 Cracked xdg-document-portal[5513]: fusermount3: failed to access mountpoint /run/user/1000/doc: Permission denied
Mai 28 19:11:25 Cracked systemd[1105]: Started flatpak document portal service.
Mai 28 19:11:25 Cracked systemd[1105]: Started sandboxed app permission store.
Mai 28 19:11:25 Cracked systemd[1105]: Starting sandboxed app permission store...
Mai 28 19:11:25 Cracked systemd[1105]: Starting flatpak document portal service...
Mai 28 19:11:25 Cracked systemd[1105]: Starting Portal service...
Mai 28 19:11:25 Cracked drkonqi-coredump-launcher[5487]: Available platform plugins are: vkkhrdisplay, vnc, linuxfb, xcb, offscreen, minimal, wayland-egl, wayland.
Mai 28 19:11:25 Cracked drkonqi-coredump-launcher[5487]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Mai 28 19:11:25 Cracked drkonqi-coredump-launcher[5487]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Mai 28 19:11:25 Cracked drkonqi-coredump-launcher[5487]: qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
Mai 28 19:11:25 Cracked drkonqi-coredump-launcher[5487]: qt.qpa.xcb: could not connect to display
Mai 28 19:11:25 Cracked drkonqi-coredump-launcher[5486]: Unable to find file for pid 1200 expected at "kcrash-metadata/kwin_wayland.4ed09713e8ef4929a948569943931ce3.1200.ini"
Mai 28 19:11:25 Cracked systemd[1105]: Started Launch DrKonqi for a systemd-coredump crash (PID 5432/UID 0).
Mai 28 19:11:25 Cracked systemd-coredump[5431]: [🡕] Process 1200 (kwin_wayland) of user 1000 dumped core.
Mai 28 19:11:25 Cracked systemd-coredump[5431]: elfutils disabled, parsing ELF objects not supported[/code]
Comment 1 Akseli Lahtinen 2024-05-29 06:40:31 UTC
Hi, can you share a backtrace for the crash with debug symbols? Thanks!

https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
Comment 2 ollilein 2024-05-29 21:55:38 UTC
Created attachment 169959 [details]
Backtrace of plasmashell crashing

Today i recompiled my system with cflags "-march=znver3 -O2 -mtune=znver3 -pipe -g -ggdb" and FEATURES="parallel-install parallel-fetch fixlafiles nostrip" so that everything is compiled with debug symbols.

I startet gdb with "gdb -q /usr/bin/plasmashell"

But in the logfile there comes only the output "no stack".

These are the last lines in gdb before plasmashell crashes:
Thread 0x7fff956006c0 (LWP 2693) exited]
[Thread 0x7fff8b4006c0 (LWP 2692) exited]
[Thread 0x7fff72a006c0 (LWP 2591) exited]org.kde.pulseaudio: No object for name "alsa_output.pci-0000_09_00.1.hdmi-stereo"
[New Thread 0x7fffa2a006c0 (LWP 2685)]
[New Thread 0x7fff8b4006c0 (LWP 2686)]
[New Thread 0x7fff956006c0 (LWP 2687)]
[Thread 0x7fff956006c0 (LWP 2687) exited]
[Thread 0x7fff8b4006c0 (LWP 2686) exited]
[Thread 0x7fffa2a006c0 (LWP 2685) exited]
[New Thread 0x7fffa2a006c0 (LWP 2691)]
[New Thread 0x7fff8b4006c0 (LWP 2692)]
[New Thread 0x7fff956006c0 (LWP 2693)]
org.kde.pulseaudio: No object for name "alsa_output.pci-0000_09_00.1.hdmi-stereo"
The Wayland connection broke. Did the Wayland compositor die?
[Thread 0x7fff734006c0 (LWP 2590) exited]
[Thread 0x7fff73e006c0 (LWP 2589) exited]
[Thread 0x7fff7e0006c0 (LWP 2588) exited]
[Thread 0x7fff7ea006c0 (LWP 2587) exited]
[Thread 0x7fff7f4006c0 (LWP 2586) exited]
[Thread 0x7fff70a006c0 (LWP 2585) exited]
[Thread 0x7fff714006c0 (LWP 2576) exited]
[Thread 0x7fff71e006c0 (LWP 2572) exited]
[Thread 0x7fff7d0006c0 (LWP 2571) exited]
[Thread 0x7fffc56006c0 (LWP 2532) exited]
[Thread 0x7fffc60006c0 (LWP 2531) exited]
[Thread 0x7fffc6a006c0 (LWP 2530) exited]
[Thread 0x7fffc74006c0 (LWP 2528) exited]
[Thread 0x7fffcf4006c0 (LWP 2525) exited]
[Thread 0x7fffcfe006c0 (LWP 2524) exited]
[Thread 0x7fffe4c006c0 (LWP 2523) exited]
[Thread 0x7fffd7e006c0 (LWP 2519) exited]
[Thread 0x7fffdd2006c0 (LWP 2505) exited]
[Thread 0x7fffe74006c0 (LWP 2491) exited]
[Thread 0x7fffe7e006c0 (LWP 2490) exited]
[Thread 0x7fffed6006c0 (LWP 2489) exited]
[Thread 0x7ffff0373a00 (LWP 2486) exited]
[Thread 0x7fffa2a006c0 (LWP 2691) exited]
[New process 2486]
[Inferior 1 (process 2486) exited with code 0377]

I hope it helps.
Comment 3 ollilein 2024-05-29 22:00:07 UTC
I forgot something, dmesg says:

[  172.436605] kwin_wayland[1197]: segfault at 58 ip 00007f2619081ab4 sp 00007fff52b0c408 error 4 in libkwin.so.6.0.90[7f2618f4d000+55b000] likely on CPU 31 (core 15, socket 0)
[  172.436614] Code: b2 7c ef ff 66 90 5b c3 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f3 0f 1e fa c6 47 5c 01 c3 90 66 0f 1f 44 00 00 f3 0f 1e fa <8b> 47 58 ff 4f 54 85 c0 75 06 80 7f 5c 00 75 0c c3 66 66 2e 0f 1f
Comment 4 ollilein 2024-05-29 22:32:57 UTC
Created attachment 169960 [details]
Backtrace from crashing kwin_wayland

Since i found out that "kwin_wayland" is crashing i made a backtrace with "gdb -q /usr/bin/kwin_wayland".

I think that the Problem is "kwin_wayland"
Comment 5 Vlad Zahorodnii 2024-05-31 08:33:07 UTC
Did host or nested kwin_wayland crash? How do you run plasma?
Comment 6 ollilein 2024-05-31 09:01:46 UTC
(In reply to Vlad Zahorodnii from comment #5)
> Did host or nested kwin_wayland crash? How do you run plasma?

Both are crashing, i had running plasma_wayland in gdb and normal in the plasmashell. Both crashed at the same time, but i could only get a backtrace for the one which was startet by gdb.

I start plasma through my .bashrc with the following command:
if [ "$(tty)" = "/dev/tty1" ]
then
    exec /usr/bin/dbus-run-session /usr/bin/startplasma-wayland
fi
and then use systemd autologin for tty1.

I do this because sddm is making trouble on my PC.
Comment 7 ollilein 2024-06-02 16:03:34 UTC
Created attachment 170065 [details]
Backtrace from kwin-6.0.90.1-r1

I updated kwin from 6.0.90 to 6.0.90.1-r1 (gentoo version) and it keeps crashing sometimes.
Comment 8 David Edmundson 2024-06-03 05:21:01 UTC
>I start plasma through my .bashrc with the following command:

Not using a display manager is not supported. There is a lot the display manager does that you're not doing.

It's also the cause of your issue, kwin is trying to start nested inside another kwin that isn't running because.

If any issue persists with LightDM/GDM/SDDM please reopen this bug
Comment 9 ollilein 2024-06-03 08:39:34 UTC
I now started with sddm, and the bug differs a bit, kwin_wayland keeps crashing sometimes but plasmashell is now restartet automatically, which i had to do manually before.
Comment 10 ollilein 2024-06-03 08:42:08 UTC
Created attachment 170080 [details]
kwin_wayland-6.0.90.1-r1-new

I should say that i start kwin_wayland through the konsole as a second process with gdb, so there is another instance running from "native" plasmashell.

So it keeps crashing.
Comment 11 kostadinshishmanov 2024-06-08 07:28:11 UTC
Created attachment 170249 [details]
kwin backtrace

I am also running into this I believe (using sddm). Everything on my system is built with -ggdb3, so the backtrace might be more useful than just -ggdb.
Comment 12 Bug Janitor Service 2024-06-10 11:07:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5865
Comment 13 Zamundaaa 2024-06-10 11:58:04 UTC
Git commit 0c5ee4789215eefd838a6b97783a05ac6cd01433 by Xaver Hugl.
Committed on 10/06/2024 at 11:46.
Pushed by zamundaaa into branch 'master'.

core/renderbackend: check for the renderloop being deleted

Output frames can outlive the output they were created for, so the render loop
might also be deleted by the time the output frame is destroyed or presented

M  +4    -2    src/core/renderbackend.cpp
M  +1    -1    src/core/renderbackend.h

https://invent.kde.org/plasma/kwin/-/commit/0c5ee4789215eefd838a6b97783a05ac6cd01433
Comment 14 Zamundaaa 2024-06-10 12:14:17 UTC
Git commit ea83fc0052d9622e8ebe96a7de884ec486fab382 by Xaver Hugl.
Committed on 10/06/2024 at 12:01.
Pushed by zamundaaa into branch 'Plasma/6.1'.

core/renderbackend: check for the renderloop being deleted

Output frames can outlive the output they were created for, so the render loop
might also be deleted by the time the output frame is destroyed or presented


(cherry picked from commit 0c5ee4789215eefd838a6b97783a05ac6cd01433)

Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>

M  +4    -2    src/core/renderbackend.cpp
M  +1    -1    src/core/renderbackend.h

https://invent.kde.org/plasma/kwin/-/commit/ea83fc0052d9622e8ebe96a7de884ec486fab382
Comment 15 ollilein 2024-06-10 13:53:50 UTC
Created attachment 170340 [details]
Patch for kwin-6.0.90.1

I made a patch from https://invent.kde.org/plasma/kwin/-/commit/0c5ee4789215eefd838a6b97783a05ac6cd01433 for the "native" Version of kwin 6.0.90.1
Comment 16 ollilein 2024-06-10 13:55:10 UTC
Created attachment 170341 [details]
Patch for kde-plasma/kwin-6.0.90.1-r2

I made a patch for the gentoo patched Version kde-plasma/kwin-6.0.90.1-r2
Comment 17 ollilein 2024-06-10 14:43:57 UTC
I tried the patch for the gentoo patched kwin-6.0.90.1-r2, and it look like there are no more crashes. I tested for 40 minutes with every minute screen blank and kwin hasn't crashed dureing this test.

So i would say it is fixed with this patch, but i cannot say for sure for the "native" version 6.0.90.1 because i can't test it at the moment, but i think it should also be crash free.