Bug 487750 - Kwin never notifies the systemd watchdog and gets killed
Summary: Kwin never notifies the systemd watchdog and gets killed
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: git-stable-Plasma/6.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-29 16:20 UTC by Jonas Rakebrandt
Modified: 2024-09-30 11:10 UTC (History)
3 users (show)

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


Attachments
CMake Log (5.63 KB, application/gzip)
2024-05-30 17:31 UTC, Jonas Rakebrandt
Details
Systemd journal log (822 bytes, application/gzip)
2024-06-02 13:15 UTC, Jonas Rakebrandt
Details
Oliver's log during Arch update from 6.0.90 to 6.1.0 (224.46 KB, text/plain)
2024-06-18 20:12 UTC, Oliver Beard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Rakebrandt 2024-05-29 16:20:21 UTC
SUMMARY
This may very well just be some mis-configuration on my system but Kwin never sends anything to the systemd unit watchdog. This then results in systemd killing Kwin after the configured watchdog timeout (15s).
Only tested on Wayland because I don't have an X-server installed at the moment.

STEPS TO REPRODUCE
1. Log into a Plasma (Wayland) Session
2. Wait 15 seconds

OBSERVED RESULT
Kwin gets killed by systemd, shown in the journal afterwards.
(If you are quick you can see `systemctl --user status plasma-kwin_wayland.service` never reaching the "active" state)

EXPECTED RESULT
Kwin should notify systemd as intended.

My current workaround is reverting plasma-kwin_wayland.service to the old
[Service]
ExecStart=/usr/bin/kwin_wayland_wrapper --xwayland
BusName=org.kde.KWinWrapper
Slice=session.slice 

SOFTWARE/OS VERSIONS
Operating System: Gentoo 2.15
KDE Plasma Version: 6.0.90
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Kernel Version: 6.9.2-linux-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7800X3D 8-Core Processor
Memory: 62.0 GiB of RAM
Graphics Processor: AMD Radeon RX 5700 XT
Manufacturer: ASUS
Comment 1 Jonas Rakebrandt 2024-05-29 16:21:15 UTC
Tested with Kwin commit: 0e9b0fd4046908d609e243d57af896e2ce590359
Comment 2 David Edmundson 2024-05-30 04:05:57 UTC
>Operating System: Gentoo 2.15

This situation could occur if kwin is compiled without libsystemd and then run with systemd.

Could you double check the cmake output of the kwin build please.
Comment 3 Jonas Rakebrandt 2024-05-30 17:31:25 UTC
Created attachment 169994 [details]
CMake Log

Here's the CMake log, it can definitely find libsystemd and libsystemd is also linked to the final kwin_wayland binary (in ldd output)
Comment 4 Jonas Rakebrandt 2024-06-02 13:15:16 UTC
Created attachment 170063 [details]
Systemd journal log

This could be a relevant part of the systemd journal - especially the "Cannot find unit for notify message of PID 9192, ignoring." (9192 being kwin_wayland_wrapper) part.
Looks like Kwin is sending the notifies properly but systemd can't associate the process with plasma-kwin_wayland.service (?)
Comment 5 Bug Janitor Service 2024-06-17 03:47:03 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 6 Oliver Beard 2024-06-18 20:10:45 UTC
It looks like this might be cause of session death whilst updating in Arch Linux. I've seen this when updating from 6.0 to 6.1 beta, and from 6.1 beta to 6.1 (release).

Potentially relevant lines from log:
  Jun 18 19:55:02 Oliver-Laptop systemd[828]: plasma-kwin_wayland.service: Got notification message from PID 1980, but reception is disabled
  Jun 18 19:55:02 Oliver-Laptop systemd[828]: plasma-kwin_wayland.service: Watchdog timeout (limit 15s)!
  Jun 18 19:55:02 Oliver-Laptop systemd[828]: plasma-kwin_wayland.service: Killing process 1973 (kwin_wayland_wr) with signal SIGABRT.
  Jun 18 19:55:02 Oliver-Laptop systemd[828]: plasma-kwin_wayland.service: Killing process 1980 (kwin_wayland) with signal SIGABRT.
  Jun 18 19:55:02 Oliver-Laptop systemd[828]: plasma-kwin_wayland.service: Killing process 2039 (Xwayland) with signal SIGABRT.
  Jun 18 19:55:02 Oliver-Laptop systemd[828]: plasma-kwin_wayland.service: Killing process 14081 (kscreenlocker_g) with signal SIGABRT.
Comment 7 Oliver Beard 2024-06-18 20:12:36 UTC
Created attachment 170607 [details]
Oliver's log during Arch update from 6.0.90 to 6.1.0
Comment 8 Vlad Zahorodnii 2024-06-19 06:45:11 UTC
We disabled the watchdog in 6.1 release. Is kwin still getting killed in 6.1.0?
Comment 9 Jonas Rakebrandt 2024-06-22 11:47:36 UTC
(In reply to Vlad Zahorodnii from comment #8)
> We disabled the watchdog in 6.1 release. Is kwin still getting killed in
> 6.1.0?

No, with watchdog disabled in 6.1.0 kwin doesn't get killed
Comment 10 Vlad Zahorodnii 2024-09-30 11:10:19 UTC
the watchdog got disabled in master and 6.2