Repository navigation
Real-time scheduling. Hyprland dies by SIGKILL when reconnecting HDMI #16648
Replies: 6 comments 2 replies
|
Ok, with the help from AI I traced On reconnect, one Query returned successfully then |
|
working on fix |
|
I have a similar issue on an HDMI monitor when turning dpms off, also traced to a SIGKILL from RLIMIT_RTTIME and |
|
Same thing here on Intel, with a different trigger. That makes me think a fix in the connector-probe path alone won't cover it. Setup: Hyprland 0.57.0 (0aa6745, Arch package), aquamarine 0.15.1, kernel 7.2.8 (Omarchy build, What happens: this started the same day I upgraded from 0.56.2 to 0.57.0. I had six compositor deaths that day. Four were with Steam running, one of them under a minute after launching a game. One was about 2.5 minutes after unlocking from idle (DPMS on), while a big system update was running. No hotplug was involved in any of them. Every one looks the same:
On the running instance: In one case, before the death at 20:58:36, both outputs went through DPMS off/on. At 20:58:29 an Xwayland client logged I haven't caught the exact kernel path the way you did. On I'm switching to |
|
The root issue here is that RLIMIT_RTTIME is only checked when the thread returns to userspace, and the hard limit is checked first. We already have a SIGXCPU handler that demotes the main thread when it goes over the soft limit, but it can only run in userspace. In these cases the thread is stuck in the kernel (on connector probes). By the time the thread returns, the count is already past the 200 ms hard limit, so the kernel sends SIGKILL and the handler never gets a chance to demote the main thread. Moving the slow call off the realtime thread, like hyprwm/aquamarine#459 does for connector probes, fixes that one path but not the underlying problem. Any kernel call on the main thread that spins for too long can trigger the same SIGKILL, and which ones do depends on the driver and the hardware. Chasing each one down is whack-a-mole, and the next one we miss crashes the compositor again. The fix I'll try is a small watchdog thread that checks every ~20 ms whether the main thread has slept recently. If it goes about 150 ms without sleeping, the watchdog demotes it from the outside. That works even while it's stuck in a syscall. The compositor then stays at the highest normal priority for the rest of the session. The same watchdog thread could then repromote the main thread to realtime once it has seen it sleep again after a hold-off, and only fall back to high priority for good if the stalls keep coming (eg. a second one within 10 minutes). I won't implement the repromote logic for now. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hyprland version
v0.56.0 built from branch main at commit a1c2428
Is this a regression?
Unsure
What's the bug?
LG C1 is the only display connected to RTX 5090. When I unplug HDMI and reconnect it, Hyprland dies and restarts in recovery mode.
There's no crash report or core dump and
straceshowedSIGKILL.Workaround
Before workaround Hyprland was using
SCHED_RRwith priority 1.Probably related: #15465
Runtime workaround
Switch Hyprland to normal scheduling with
chrt -o -R -p 0 <PID>Permanent workaround
Set
HYPRLAND_NO_RT=1Setup
Reproduction steps
OR
Attachments
failure-hotplug-excerpt.txt
launcher-exit-trace.txt
normal-scheduling-hotplug-excerpt.txt
normal-scheduling-metadata.txt
I acknowledge that:
I have searched all (open and closed) discussions and issues and my problem is not there.
I have read the Code of Conduct and agree to follow it.
I wrote this request with my own hands, my own keyboard, and in my own words.
All reactions