Bug 487764 - kwin_wayland start with black screen and it crash after start plasmashell
Summary: kwin_wayland start with black screen and it crash after start plasmashell
Status: RESOLVED DOWNSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-crash (show other bugs)
Version: git-stable-Plasma/6.1
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-29 20:17 UTC by Gonçalo Negrier Duarte
Modified: 2024-06-01 23:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
plasma-kwin_wayland.log (10.44 KB, text/x-log)
2024-05-30 13:10 UTC, Gonçalo Negrier Duarte
Details
start-plasmawayland.gdb.txt (4.46 KB, text/plain)
2024-05-30 14:16 UTC, Gonçalo Negrier Duarte
Details
plasmashell-gdb.txt (2.03 KB, text/plain)
2024-05-30 14:28 UTC, Gonçalo Negrier Duarte
Details
kwin-systemd-missing-included.patch (312 bytes, patch)
2024-06-01 23:30 UTC, Gonçalo Negrier Duarte
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gonçalo Negrier Duarte 2024-05-29 20:17:49 UTC
SUMMARY
Starting KDE Plasma 6.0.90 in Wayland mode, produce a crash after a few second after plasmashell have started.
Also when starting KDE, kwin load with the black screen, plasma-shell only open after triggering a kde wallet event (for example open chromium)

Also kwallet ask for my password even being configure to auto-unlock via SDDM, so kwallet also seems to be half broken

STEPS TO REPRODUCE
1.  Update KDE Plasma to version 6.0.90
2.  Start KDE Plasma from SDDM
3.  Start any application tha uses kwallet for plasmashell to start

OBSERVED RESULT
After starting KDE, it display a black screen, with all the keyboard gesture and shortcut working and a cursor.
To trigger the start of plasmashell is need to open a application that use kwallet, after that the kde spash screen appears.
Wait a few second and KDE crash.

EXPECTED RESULT
Starting KDE and both kwin and plasmashell start without any problems.

SOFTWARE/OS VERSIONS
OS:  Gentoo Linux 2.15 - Kernel 6.9.1
(available in About System)
KDE Plasma Version: 6.0.90
KDE Frameworks Version: 6.2
Qt Version: 6.7.1

ADDITIONAL INFORMATION

The error from the kde crash is the following:
```bash
org.kde.startup: "kdeinit5_shutdown" QList() exited with code 255
startplasma-wayland: Shutting down...
startplasmacompositor: Shutting down...
startplasmacompositor: Done.
```

This error doesn't seem to happen on X11.
My machine is a Lenovo Legion 15ACH6H and this issue can be reproduce on Wayland on both Hybrid and Dgpu mode (AMD+Nvidia ).

I also using SDDM on wayland mode with Kwin, but should affect anything because X11 mode works fine.
Comment 1 Gonçalo Negrier Duarte 2024-05-30 10:31:27 UTC
Forget to specify that I'm using the llvm profile on gentoo with systemwide libcxx
Comment 2 Marco Martin 2024-05-30 12:11:29 UTC
Can you try to reproduce with a backtrace? https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
Comment 3 Vlad Zahorodnii 2024-05-30 12:12:37 UTC
Can you also check kwin_wayland's logs please? They can be retrieved using `journalctl --user-unit plasma-kwin_wayland --boot`?
Comment 4 Gonçalo Negrier Duarte 2024-05-30 13:10:33 UTC
Created attachment 169984 [details]
plasma-kwin_wayland.log

(In reply to Marco Martin from comment #2)
> Can you try to reproduce with a backtrace?
> https://community.kde.org/Guidelines_and_HOWTOs/Debugging/
> How_to_create_useful_crash_reports

I the process of recompiling plasma-worksapaces with all the debug symbols enable again, I gonna try to create a backtrace using gdb, seems that "Dr. Konqi"  is not creating one.

(In reply to Vlad Zahorodnii from comment #3)
> Can you also check kwin_wayland's logs please? They can be retrieved using
> `journalctl --user-unit plasma-kwin_wayland --boot`?

The output is on the attachments
Comment 5 Gonçalo Negrier Duarte 2024-05-30 14:16:39 UTC
Created attachment 169986 [details]
start-plasmawayland.gdb.txt

(In reply to Marco Martin from comment #2)
> Can you try to reproduce with a backtrace?
> https://community.kde.org/Guidelines_and_HOWTOs/Debugging/
> How_to_create_useful_crash_reports

This attachment is debugging startplasma-wayland directly
Comment 6 Gonçalo Negrier Duarte 2024-05-30 14:20:15 UTC
I also notice after enable debug symbol by the use of `-ggdb` on `CFLAGS` and `CXXFLAGS` and the FEATURES="splitdebug".
Configuration taken from https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces

Plasmashell restart itself and dosent seem to crash again, but I will try to run now to be sure I gonna also see if Dr. Konqi can give me a backtrace after plasmashell restarts
Comment 7 Gonçalo Negrier Duarte 2024-05-30 14:28:47 UTC
Created attachment 169987 [details]
plasmashell-gdb.txt

This backtrace is debugging plasmashell directly, it occurs two crash before kwin kill itself.
Comment 8 Gonçalo Negrier Duarte 2024-05-30 14:42:57 UTC
Well with the debug enable and compiling with `-O2` (-O3 is not recomended, and wasn't producing a good backtrace), it seems to take a bit longer to crash, but it crash with the same error.

Note the backtrade in the attachments was with plasma-workspace compiled with `-O2` instead of `O3`:
```bash
/etc/portage/env/debug
-----------------------------------------
COMMON_FLAGS="-march=native -O2 -pipe -fdiagnostics-color=always -ftree-vectorize -fno-semantic-interposition -flto=thin"
CFLAGS="${COMMON_FLAGS} -ggdb"
CXXFLAGS="${CFLAGS}"

FEATURES="splitdebug
```
Comment 9 Gonçalo Negrier Duarte 2024-06-01 23:30:08 UTC
Created attachment 170058 [details]
kwin-systemd-missing-included.patch

I decided to make some extensive testing and this was what I found.
When using `MYCMAKEARGS="-DLIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION=2"` in `sys-libs/libcxx` and `kde-plasma/plasma-workspace` like is was done in BUG 479679, comment 23, and didn't solve my problems. (Also some discussion in gentoo bug https://bugs.gentoo.org/923292)

Today this [Gentoo BUG 933120](https://bugs.gentoo.org/933120) was solved by the used of the [patch in this comment](https://bugs.gentoo.org/933120#c9) and notice that my problem with plasma-workspace in wayland was complete solved (also the broken kwallet autounlock).

To be extra sure I recompiled `sys-libs/libcxx` and `kde-plasma/plasma-workspace` without the `MYCMAKEARGS="-DLIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION=2"` env and yes the issues is complete gone when using the patch above

So this bug only happen if kwin is compiled without systemd support!

Here is the gentoo ebuild lines that enable systemd support: https://gitweb.gentoo.org/repo/gentoo.git/tree/kde-plasma/kwin/kwin-6.0.90.1-r1.ebuild#n129
Comment 10 Gonçalo Negrier Duarte 2024-06-01 23:31:22 UTC
Gonna marked as RESOLVED DOWNSTREAM